How to change user's default database using SQL for SQL Server 2000?
I tried:
ALTER LOGIN user
WITH DEFAULT_DATABASE = defaultDB
but it says:
Line 1: In开发者_运维知识库correct syntax near 'LOGIN'.
I know this works in 2005+ but is there a different way in 2000?
exec sp_defaultdb @loginame='someone', @defdb='dbname'
Or since there are only those 2 parameters,
exec sp_defaultdb 'someone', 'dbname'
Abe, the ALTER LOGIN
statement was introduced in SQL Server 2005
, you must try using the sp_defaultdb
stored procedure how @cyberkiwi suggest.
精彩评论