-1

I have create new login and I have to map same login to three different databases but default database language need to be set to British English how to do this can anyone help me??

0

I have to map same login to three different databases

Login's are Server level objects..So you can create a login and create users for that login in different databases..

also i see Create login syntax accepts Language as a parameter..so you need not change default server configuration.

Syntax for SQL Server (stripped to show only relevant info )

CREATE LOGIN login_name { WITH | FROM }
::=
DEFAULT_DATABASE = database
| DEFAULT_LANGUAGE = language

So you can create something like below

create login loginname from windows
with DEFAULT_LANGUAGE="language name you want"

Also note,above language should be language from sys.languages..Here is what MSDN says about this..

The default language for a login can be overridden by using CREATE LOGIN or ALTER LOGIN. The default language for a session is the language for that session's login, unless overridden on a per-session basis by using the Open Database Connectivity (ODBC) or OLE DB API

Once you create a login,you can create a user for that login in required databases like below

CREATE USER username FOR LOGIN loginname

also you can create user specific languages for that login as well

0

You can create SQL login through TSQL statement and also set your default database as well as default language.

CREATE LOGIN Dilshad WITH PASSWORD=N'pass@word1'
    MUST_CHANGE, CHECK_EXPIRATION=ON, CHECK_POLICY=ON,
    DEFAULT_DATABASE=[CampData], DEFAULT_LANGUAGE=[British];

I am also attaching the one output image after setting the default language and default database to a particular user id ( That is 'Dilshad').

enter image description here

For Newer version to retrieve all Logins in SQL Server, you can execute the following SQL statement:

SELECT *
FROM master.sys.sql_logins;

In SQL Server, there is a catalog view (ie: system view) called sys.sql_logins. You can run a query against this system view that returns all of the Logins that have been created in SQL Server as well as information about these Logins.

Note: Older Version Compatibility

In older versions of SQL Server, you can retrieve all Logins using the SQL Server 2000 system tables such as the sys.syslogins table.

SELECT *
FROM master.sys.syslogins;

For your Ref :- Here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.