Set default language and database for db user

Execute the following SQL Server T-SQL scripts in Management Studio Query Editor to demonstrate the setting of default langauage and default database:

– Setting  default language for login
use master
              
EXEC sp_defaultlanguage‘mydbuser’, ‘us_english’
GO
             
– SQL Server  2005 and SQL Server 2008
              
ALTER LOGIN mydbuser WITH DEFAULT_LANGUAGE = British;
GO
              
– Languages in  SQL Server 2008 with dateformat
SELECT LanguageID = langid,
       name,
       alias,
       dateformat
FROM sys.syslanguages
ORDER BY langid
GO
————
              
– Setting  default database for login
EXEC sp_defaultdb‘mydbuser’, ‘mydatabase’
              
– SQL Server  2005 and SQL Server 2008
              
ALTER LOGIN mydbuser WITH DEFAULT_DATABASE = mydatabase;
GO
———

Share

- has written 121 posts.


Leave a Reply

You must be logged in to post a comment.