Table By User Id

Nov 29, 2007

I have an application (vb 2005) that reads 8 different tables in 8 different data base and builds a table for the selected records (using sp's). This table is used as basis for building a data grid and cosequently export to crystal report.

My question: How can I create a table for each user, so multiple users can run the same program at the same time. I tried using #temptable but that did not work. Can I in a sp create a table with a name that contains the user id passed to the sp as a parm?

View 1 Replies


ADVERTISEMENT

The OLE DB Provider MSDAORA For Linked Server .... Does Not Contain The Table COUNTRY. The Table Either Does Not Exist Or The Current User Does Not Have Permissions On That Table.

Jun 13, 2006

I am using SQL Server 2005 and trying to create a linked server on Oracle 10. I used the commands below:
EXEC sp_addlinkedserver
@server = 'test1',
@srvproduct = 'Oracle',
@provider = 'MSDAORA',
@datasrc = 'testsource'
exec sp_addlinkedsrvlogin
@rmtsrvname = 'test1',
@useself = 'false',
@rmtuser='sp',
@rmtpassword='sp'
 
When I execute
select * from test1...COUNTRY
I get the error. "The OLE DB provider "MSDAORA" for linked server "...." does not contain the table "COUNTRY". The table either does not exist or the current user does not have permissions on that table."
The 'sp' user I am connecting is the owner of the table. What could be the problem ?
Thanks a lot.

View 3 Replies View Related

User Defined Function: Convert String Value Of Table To Table Object

Jul 20, 2005

Does anyone know where to find or how to write a quick user defined fucntionthat will return a table object when passed the string name of the tableobject. The reason why I want dynamicallly set the table name in a storedprocudue WITHOUT using concatination and exec a SQL String.HenceIf @small_int_parameter_previous = 1 then@vchar_tablename = "sales_previous"else@vchar_tablename = "sales"Endselect * from udf_TableLookup(@vchar_tablename )So if I pass 1, that means I want all records from "sales_previous"otherwise give me all records from "sales" (Sales_Previous would last yearssales data for example).udf_TableLookup would I guess lookup in sysobjects for the table name andreturn the table object? I don't know how to do this.I want to do this to avoid having 2 stored procedures..one for current andone for previous year.Please respond to group so others may benfiit from you knowledge.ThanksErik

View 2 Replies View Related

SQL Call To Count The Total Rows In Table B For Each User In Table A

Jan 17, 2006

I have 2 tables:
 
TableA:
Name
UserA
UserB
UserC
 
Table B:
Name               Data
UserA              xxx
UserB              asdasd
UserB              ewrsad
UserC              dsafasc
UserA              sdf
UserB              dfvr4
 
I want to count the total entries in Table B for every user in Table A.  The output would be:
 
Name               Count
UserA              2
UserB              3
UserC              1
 
I can use a Select Count statement, but I will have to make a SQL call for every user in Table A.  Also, Table A is dynamic, so the users are always changing.  Can this be incorporated into one SQL call to count the total rows in Table B for each user in Table A?

View 5 Replies View Related

Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path. Please Make Sure The User Has A Local User Profile On The Computer. The Connection Will Be Closed

Dec 7, 2006

This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee

View 3 Replies View Related

How To Create A System Type Table/ Change User Table To System Table.

May 23, 2007

Is there any Posibility to change a User Table to System Table.

How to create one system table.

I am in Big mess that One of the Table I am using is in System Type.

I cant Index the same. Is there any Mistake we can change a user table to system table.....

View 9 Replies View Related

Table Design Of User Table.

Jun 23, 2006

We are in the early stages of developing a small project and I have a question I would like an opinion on.
When deciding how to design a table to store information on users who will be different types.
The project involves setting up webpage that allow " appointment setters" to book demos for our Sales reps. We want to keep track of how many each appointment setter books.
I  have a user table with user_id, fname,lname, type. Where type represents the type of users they will be either "appointment setter" or "Sales Rep".
In the Appointment table I would like to store the Appoinment setter ID, sales rep Id, date/time appointment was booked and some other data on the appointment.
My question is how do I set up the relationship from  the appointment table back to the user table.
Since each record in the appointment table will have a App Setter ID and a Sales Rep ID.
Should I just pick either the app setter id or the sales rep id as the foreign key back to the userID in the user table. Or is there another method how to handle this.
Any thoughts or articles would be greatly appreciated.
thanks,

View 1 Replies View Related

Create Table With User Specified Table Name

Jan 19, 2008

ok suppose i want to  create a table with a user specified name...... how should i replace the name with the variable name="table1"         Dim condb string .......         Dim cmdDB2 As SqlCommand               Dim  name as string=("table1")        Dim selkta As String = "CREATE TABLE name(no int,quest text,op1 text)"             cmdDB2 = New SqlClient.SqlCommand(selkta, conDB)        conDB.Open()        cmdDB2.ExecuteNonQuery()        conDB.Close()thank u    

View 4 Replies View Related

How Do We Determine Which User Database Tables Are Mostly Retrieved By User Or Modified By User?

May 22, 2008



Hi,
Please give the T-SQL script for this ? Thanks

Shanth


View 4 Replies View Related

User Table

Jul 20, 2005

I am new to the database. I have a user table.Currently, when I open this table thru Enterprise, I can see allpasswords and usernames.Is there anyway I can make this table more secure?Any tips for handling user table will help.

View 1 Replies View Related

More Than One User Inserting Onto A Table

Nov 7, 2006

Hi, i want to make a poll, i mean a user logs in and vote, the vote i want it to be an insert onto a table containing only the answer so when all users have voted i'll count the results. My problem is, imagine 2 people submiting at same time, will they be able to insert on the table sucessfuly? Do Sql Server allow shuch an operation? Please tell me if i'll have problems and what have to do, also the best method to do a poll. Thanks in advance. 

View 1 Replies View Related

Designing My User Table

Feb 13, 2008

Hey,I have a fairly large table for my keeping my information about users. My question is, would it be better to separate it, for example, create another table that has all the personal information (like city, street, etc)and have it related to my other table where more of the data-ish information is kept? Thanks,Sixten 

View 3 Replies View Related

How To Add New Table Under Specific User?

Jun 14, 2004

I'm new to SQL Server.

I've an online Database on a server. I've my own user name like "AKR". I want to create every table under that user. But what happens is whenever I create a table online it goes under "DBO" user name. How to avoid that?

Thanks

View 1 Replies View Related

Can't Access A User Table

Jun 5, 2001

My problem is that I can't query a couple of tables. I created them using DTS myself, in a db called contracts, and called one of them 010425. I've logged in as SA, and making sure the correct DB is shown in Query Analyser.

Here's the query...and very simple it is;

SELECT TOP 10 * FROM [dbo].[010425]

I just keep getting the following error message;

Server: Msg 208, Level 16, State 1, Line 1 Invalid object name 'dbo.010425'.

But it shows up in Sysobjects and EM!

I can query the system tables, using EXACTLY the same syntax...no problem there.

I've got SQL Server 7 running on W98. Everything is happening locally.

Any ideas what I'm doing wrong, people?

Thanks in advance for your help,


Jaishel

View 1 Replies View Related

How To Grab User Name Into The Table

Aug 21, 2001

I want to include the name of the user whom so ever has changed the record.
I want to insert the name of the user in the column.
How to grab the name of the user from the action...?

Thanks,
Harish

View 1 Replies View Related

Allow User To See Table Definition

May 8, 2008

I have set up a couple of views for a user but they want to be able to see the database table columns by doing right click on table and getting the columsn.

I tried to give the permissions to database by right clicking on database and doing the user and giving view defintion.

-- [TABLEA] contains no columns that can be inserted or the current user does not have permissions on that object.

User not allowed to select the data .

Thanks

View 2 Replies View Related

How To Structure My Table For User Alerts

Feb 14, 2008

Hi i want to create a page, which a user enters their email address, and ticks a few tick boxes against items they would like to be notified of. The user doesnt have to be a member of the site, how should i structure my table in the database, thank you.

View 5 Replies View Related

Select Data From Table Name User

Jun 12, 2005

Hi,I using vb.net to do this. I need to retrieve data from a table name "User".  The table is in a sql server. I having trouble retrieve data from it. This is my code
Dim strsql As String = "SELECT DISTINCT NameID FROM User"Dim cmd As New sqlCommand(strsql, cn)Dim das As New sqlDataAdapter(cmd)Dim da As DataSet = New DataSetdas.Fill(da)This is the error message.
Syntax error in FROM clause. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Source Error:



Line 31: Dim das As New sqlDataAdapter(cmd)
Line 32: Dim da As DataSet = New DataSet
Line 33: das.Fill(da)
Line 34:
Line 35: DropDownList1.DataTextField = "NameID"I have tried other table, no problem, data is retrieved. Seem like "User" is restricted word... Worse is i cannot change the table name, only thing i can do is get data from it. So hope someone can help me on this. thanks in advance!!

View 2 Replies View Related

Getting The Latest Dated Row For Each User In A Table

Dec 2, 2005

Hi all,

I want to have a query that will return me a single row for each user
from a table where the table has many rows for each user. The single
returned row for each user must be the most recently dated entry
([I7-Change-Date]) for that user.

An example of the code I have so far is as follows, but it obviously doesn;t work.select DISTINCT([I1-Customer-Ref]) AS Cust,([i7-w-fixed-amnt]) as WaterFixedAmt, ([i7-w-rv-amnt]) as WaterRVAmt, ([i7-s-fixed-amnt]) as SewerageFixedAmt, ([I7-Change-Date]) AS [Date]from r07UnMeasuredBills ORDER BY Cust, [I7-Change-Date] DESC
I am using MS SQL Server 7 for this.

Thanks

Tryst

View 6 Replies View Related

Capturing A User Table Name Into A Variable

Nov 25, 1998

Can I declare variable and assign a user defined table name in Sql server 6.5. if so how can I do that ,

Thanks

Ali

View 1 Replies View Related

Table Of User Defined Types

Apr 13, 2006

Hi!

I have a question about creating a user defined type: I'd like to create a table of employee objects which include objects of the type employee_t. I used this structure before in Oracle 9i and would like to know how it can be done with MS SQL Server 2000 or 2005, preferably with Enteprise Manager/Management Studio. Below is an example.

CREATE TYPE employee_t AS OBJECT (
name VARCHAR(10)
jobDesc VARCHAR(15)
...
)

CREATE TABLE Employee of employee_t

Regards,

Timo

View 3 Replies View Related

Get Newest Input For Each User From Table

Nov 20, 2014

I dont know how to get the newest input for each user from one single table.

Should be a very simple task but i cant work it out.

The table looks like this:

ID (A_I), userID, ip, date(timestamp)

Here is a SQL Fiddle Link with some data also: [URL] ....

I have tried a lot querys like this one:

SELECT userID, ip FROM userips GROUP BY userID ORDER BY ID DESC

But this one does not give me the latest ip which was entered by a user.

View 2 Replies View Related

User Configurable Table Designs

Jun 12, 2007

To the pros:,I have one question about designing tables and interface (web/windowsapplications). The requirement is like this.I want to design an application to manage upload / review / managefiles which has some meta data associated with them as well. The filescan be any documents. This application can be used in differentcompanies same way, but each company wants to use different fieldnames.So, I want to design tables generic enough to allow custom labellingfields. So if I have a tableT1 with ID, FileName, FileSize, FileAuthor.... some company may wantto use different field names. What's the best way to design tableslike this and how to maintain relationships, stored procs, triggersetc linked to these tables.Many thanks in advance,DS

View 1 Replies View Related

Processing User Activity Table

Jul 20, 2005

Hello,I have an application that will be logging to a SQL Server 2000database user user activity from several Windows 2003 terminalservers. This information will be retrieved by monitoring theSecurity logs of these servers (this part I know how to accomplishalready).A table in the database, tblLogEntries, will contain the followingfields:- ID = autoincrementing int- LogTime = Date/Time the user activity was recorded in the securitylog- Username = User's login ID that the activity was recorded with- Type = int, referencing a lookup table with the values of Logon,Logoff, and possible other future items- Server = The name of the server the activity was recorded on.The only question I have is, can you offer a way to process the totaluser login time during a given range using T-SQL.For Example...Given the table data:ID LogTime Username Type Server1 10-10-2003 8:30:00 Tom Logon SERVER-A2 10-10-2003 8:45:00 Sarah Logon SERVER-A3 10-10-2003 16:45:00 Tom Logoff SERVER-A4 10-10-2003 17:00:00 Sarah Logoff SERVER-A5 10-11-2003 8:30:00 Tom Logon SERVER-A6 10-11-2003 8:45:00 Sarah Logon SERVER-A7 10-11-2003 16:30:00 Sarah Logoff SERVER-A8 10-11-2003 17:15:00 Tom Logoff SERVER-AHow would you receive the output:User Logon Total Time for SERVER-ATom 17.0 hrsSarah 16.0 hrsI know I can handle this type of processing on my ASP.NET front-end,but I'm curious as to how easily it can be done by the database,itself.Thanks in advance for your assistance.

View 4 Replies View Related

Loading A Table Var Into A SSIS User Var?

Mar 12, 2008



I'm using an Execute SQL Task Editor to try and load the last load date into a user var. I don't know what I'm doing wrong.

I have result set to Single Row and a simple query:

SELECT LastLoad
FROM HeidtmanDW.dbo.CubeLoadStats
WHERE (SourceTable = 'Sales')

Where do I set the user var User:LastSalesLoadDate (which is scoped to the entire packge)?

Thanks.

View 6 Replies View Related

MSDB Table User Permissions

Sep 25, 2007

Just out of curiosity, could someone point me towards a listing of the user permissions for the MSDB table? I have looked through BOL and on the internet and cannot find a good listing. An example would be something like...
dts_admin: <dts_admin description>

Thanks in advance.
-Kyle

View 1 Replies View Related

How Many User Current Connect To A Row In Table.

Nov 9, 2006

Hi all...
Iam a newbie and i have one question want to ask experts ... .
I am current working on one App which have some user connect to database at the same time.
And i want to know: how many user connect or use (read , update) to one row in a table?
Could it be possible to know that??? If you have one solution to solve this problem , please let me know :) ...
Could it be done by Software , T-SQL or anything ...., iam happy to know.
Thanks all.

View 8 Replies View Related

Help With DBO User Can't Add Data To Table Error

Jun 22, 2007

Hi,
Question:

I just moved a database from one server to the other and now I'm getting an error when I try to modify a field in my table from management studio:
- sql2005 the user does not have permission to perform this action.

I made sure to remove all users from that database once i got it up and running on my new server and made sure I didn't have orphaned users.

I created a new userid and gave it full dbo rights. I planned on restricting permissions later.

Is there something new to check in 2005 that would prevent a user with full dbo to modify data in a table?

The table has no constraints or dependencies, it's basically a lookup table so very simple stuff.

Thanks, Seb.

View 7 Replies View Related

How Check Either One Name Of The User Is Present Or Not In Data Table From C#.net

Jan 31, 2008

hi
 can anyone help me out, i have one issue that is how i have to check while adding new user details to database table weather that user name is exist in that table or not.
for my application i'm using oracle database and C#.Net.
table is g_users and columns are:
 Name                                      Null?    Type ----------------------------------------- -------- ---------------------------- USERID                                    NOT NULL VARCHAR2(5) NAME                                               VARCHAR2(20) EMPID                                              VARCHAR2(5) USERNAME                                  NOT NULL VARCHAR2(30) MOBILE                                             NUMBER(12) EMAILID                                            VARCHAR2(20) DOMAIN                                    NOT NULL VARCHAR2(30)
i need to check from c# programming before inserting a new row into table weather username is already exists are not. how to check this one?

View 5 Replies View Related

Table Variable And User Defined Types

Oct 30, 2003

This is part of the codes of a stored procedure:

-- Create tables variables
DECLARE @_tab_PRNumList TABLE(
PRNum udt_PRNum
)

However, it cannot be compiled coz of this error:
Error 2715: Column or parameter #1: Cannot find data type udt_PRNum.

This user-defined data type is created in a user database only.

I tried to created the user-defined type into BOTH tempdb and master but same error.

How can i resolove it?
Or it is impossible to use user-defined datatype for table variable?

In the past,
i use this method:
CREATE TABLE #PRNumList (
PRNum udt_PRNum
)

and cerate udt_PRNum in tempdb only could solve it.

But now i want to use table variable.
It seems NOT work for my situation.

Any idea?

View 1 Replies View Related

Looking For A Script To Audit User Table Rights

Sep 28, 2004

Hello everyone,

Does anyone know of a quick way to audit all users in a database and display their rights and permissions on a table level. I would hate to have to do it one user at a time. There has to be an easier way.

I'm going through a Sarbanes Oxley audit and need to provide them this information.

View 2 Replies View Related

TRUNCATE TABLE In A Sproc W/locked-down User

Sep 18, 2006

Hullo folks, I'm having what I assume is a fairly mundane security issue.

I have a SQL login that I am trying to restrict as much as possible. This account's sole goal in life is to hit the server, return some usage statistics, then truncate the table it received the statistics from. I would like to refrain from granting this login permissions on the physical target table if possible.

Usually I can wrap up "protected" operations in a stored procedure, then grant exec permissions for my user and I'm good to go. However, TRUNCATE TABLE gets cranky with me when I attempt the above method. I suspect that has to do with the fact that TRUNCATE TABLE is effectively modifying the table itself as opposed to merely deleting data.

Is it possible to grant this login ONLY execute permission on a stored proc that TRUNCATE's tables without giving the user any physical permissions? Am I going about this the wrong way?

View 7 Replies View Related

User ID And Password For Importing Access Table

Oct 25, 2006

Hello, everyone:

I know it is a simple question. I am writing a query to import a table (MyTable) from an Access Database (MyDatabase.mdb). MyDatabase.mdb is in C: in local. This is the query from BOL.

SELECT a.*
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:MyDatabase.mdb';'admin';'mypwd', MyTable) AS a

By BOL, admin and mypwd should be user_ID and password. But I am doing testing in local, and don't set user_ID and password. How to handle two things.

Thanks

YTZ

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved