Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing create user procedure schema problem

Status
Not open for further replies.

daveonion

Programmer
Aug 21, 2002
359
GB
Hi,
I know this is a security problem but i am unsure which access i need to give the account, basically im running the stored procedure as below,
exec('CREATE USER ' + '[' + @Login +']' + ' FOR LOGIN [' + @Login + '] WITH DEFAULT_SCHEMA=[dbo]'),

however when a user runs it it will created the user account however it doesn't use the default schema as dbo instead is uses the login name.
It runs fine if i do it so im guessing theres a permission im missing on the dbo schema for the user.
any help would be appreciated. i know this may be better placed in sql server but its an asp.net app that runs the procedure
thank in advance
 
This is a sql question. Although you are creating the user from ASP.NET, it does not matter. It is a sql question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top