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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Msg 15007, Level 16
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

svibuk
Yak Posting Veteran

62 Posts

Posted - 10/05/2012 :  09:58:55  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 10/05/2012 :  10:14:38  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000