Thursday, 12 February 2009

Creating New User in SQL Server 2K5 and 2K8

Basically the GUI doesn't work properly - so just script it! Like this:

CREATE USER [NT AUTHORITY\NETWORK SERVICE]
FOR LOGIN [NT AUTHORITY\NETWORK SERVICE]
WITH DEFAULT_SCHEMA=[your_schema]
GO

The problem is when you want to assign a default Schema to your User - it just won't do it. You select 'your_schema', and hit 'Ok':



... only to find that your queries don't run as expected and when you go back into the settings GUI, the default Schema has gone back to 'dbo'. Grrrr ...

No comments:

Post a Comment