I tried:
ALTER LOGIN user
WITH DEFAULT_DATABASE = defaultDB
but it says:
Line 1: Incorrect syntax near 'LOGIN'.
I know this works in 2005+ but is there a different way in 2000?
master - keeps the information for an instance of SQL Server. msdb - used by SQL Server Agent. model - template database copied for each new database.
To change the user name of a user having CONTROL permission on the database requires the CONTROL permission on the database. To change the default schema or language requires ALTER permission on the user. Users can change their own default schema or language.
In that case, just use SQL Server Management Studio > Database > Security > Users > Properties and change the default schema there.
exec sp_defaultdb @loginame='someone', @defdb='dbname'
Or since there are only those 2 parameters,
exec sp_defaultdb 'someone', 'dbname'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With