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.
Author |
Topic |
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2010-12-22 : 13:29:09
|
I need a script to check for the users not exists and then create a windows authenication logins in sqlserver 2005. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2010-12-22 : 14:40:21
|
Sorry if i am not clear..I want to check a if the user already assigned the database.If the already assigned then ignore else create the new users.IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name =N'AM\sam')BEGIN CREATE LOGIN AM\sam FROM WINDOWS WITH DEFAULT_SCHEMA = Marketing;END Can you correct the above code. |
|
|
|
|
|