Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Msg 15007, Level 16

Author  Topic 

svibuk
Yak Posting Veteran

62 Posts

Posted - 2012-10-05 : 09:58:55
CREATE USER [ab12] WITH DEFAULT_SCHEMA=[ab12]
GO

i get error msg
Msg 15007, Level 16, State 1, Line 1
'ab12' is not a valid login or you do not have permission.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-10-05 : 10:14:38
Do you have a login named ab12? You can look under the security section at server level, or use this command:
SELECT * FROM sys.server_principals WHERE type_desc = 'SQL_LOGIN' and name = 'ab12';


If there is, and you are still getting the error, you may not have the required permissions to create a user.

If there is no login, you have to create a login before you can create a user.

You can also create users without login, but you will have to specify explicitly so, but more likely than not, that is not what you are trying to do/need. If you do want to create a user without login, see here: http://msdn.microsoft.com/en-us/library/ms173463.aspx
Go to Top of Page
   

- Advertisement -