I want to append the windows login name to the table that i created in the stored procedure, Is there any command , can any one help.
Advance thanksIf I understand it correctly, you want to create a table using a stored procedure and the name of the table will contain the Windows login name of the use. Is this correct? Are you calling the stored procedure from TSQL or through a .NET application? Can you provide more details?|||Hi
declare @.sql nvarchar(100)
set @.sql= 'Create table [Test_' + SYSTEM_USER +']'
exec SP_executeSQL @.sql
this may work check it but it will give u the user name if only you are logged in with windows autintication|||HI ALL
I WANTED TO CREATE A TEMPOARARY TABLE UNIQUELY WHEN DIFFERENT CLIENTS HITS THE SERVER AND EXECUTE THE SAME PROCEDURE.FOR THAT I USED HOST_NAME FOR CREATING THE TEMPORARY TABLE.IT CREATED THE TABLE APPENDING WITH HOST_NAME
THANKS|||
I don't know the whole story but it sounds like you need to keep similar data unique to a specific user.
I've done this by creating one table that has a UserID field. Then you can easily manage 1 table by passing the UserID into the SP. This works well for inserts as well as selects.
For example:
Field1 Field2 UserID
111 222 JohnDoe
333 444 JohnDoe
555 666 JoeSchmoe
777 888 JoeSchmoe
THis has worked well for me even with a large number of users and each having a large number of "User-SPecific" records.
No comments:
Post a Comment