如何更改SQL Server管理工作室的默认语言?

时间:2022-01-11 16:56:29

how to change default language of SQL server management studio?

如何更改SQL Server管理工作室的默认语言?

I tried to change default language to french by using the below query.

我尝试使用以下查询将默认语言更改为法语。

USE ssidps;
GO
EXEC sp_configure 'default language', 2 ;
GO
RECONFIGURE ;
GO

but SELECT @@language gives "us_english" always.

但SELECT @@语言总是给出“us_english”。

3 个解决方案

#1


3  

For the current session just use set language = French.

对于当前会话,只需使用set language = French。

Long term, change the user's language:

长期来看,改变用户的语言:

  • alter login someGuy with default_language = French (<= sql 2008 r2)
  • 使用default_language = French(<= sql 2008 r2)更改登录someGuy

  • alter user someGuy with default_language = French (>=sql 2012)
  • 使用default_language = French(> = sql 2012)更改用户someGuy

http://technet.microsoft.com/en-us/library/ms176060.aspx http://msdn.microsoft.com/en-us/library/ms189828.aspx

I think what you've done above is to change the default language for the database - which will affect the language assigned to new users. For existing users, they would have been created with the original default language, so would need to be updated as above.

我认为您上面所做的是更改数据库的默认语言 - 这将影响分配给新用户的语言。对于现有用户,它们将使用原始默认语言创建,因此需要如上所述进行更新。

This will do it for all users (change login to user if running SQL 2012 or above):

这将为所有用户执行此操作(如果运行SQL 2012或更高版本,则更改登录用户):

declare @l table(sqlCmd nvarchar(max))
declare @sqlCmd nvarchar(max)
insert @l
select 'alter login ' + quotename(loginname) + ' with default_language = French;' from sys.syslogins where language is not null

select top 1 @sqlCmd = sqlcmd from @l
while (@sqlCmd is not null)
begin
    print @sqlCmd
    exec(@sqlCmd)
    update @l set sqlCmd = null where @sqlCmd=sqlCmd
    set @sqlCmd = null  
    select top 1 @sqlCmd = sqlcmd from @l where sqlCmd is not null
end

Changes to a login/user's language will only be seen in new sessions; i.e. if they had a session open before you ran the script their language will be their original default. Ask them to log out and start a new session (or wait for this to happen naturally / kill their current session / restart the db) to ensure they get the new settings.

只有在新会话中才能看到对登录/用户语言的更改;即如果他们在运行脚本之前打开了会话,他们的语言将是他们的原始默认值。让他们注销并开始一个新的会话(或等待自然发生/杀死他们当前的会话/重新启动数据库)以确保他们获得新的设置。

NB: For anyone following this thread, the above answer did not fully solve @SameerPradhan's issue, so he's followed up here: https://dba.stackexchange.com/questions/52402/how-to-change-default-language-of-sql-server-management-studio-2008r2

注意:对于任何关注此主题的人,上述答案并没有完全解决@SameerPradhan的问题,所以他在此处跟进:https://dba.stackexchange.com/questions/52402/how-to-change-default-language-of - SQL服务器管理工​​作室,2008R2

#2


0  

If I understood correctly, your need is to change the language of SQL server management studio and NOT the language of SQL Server instance. Therefore How is it related to queries?!?

如果我理解正确,您需要更改SQL Server管理工作室的语言而不是SQL Server实例的语言。因此,它与查询有什么关系?!?

...

Changing the SSMS configuration is done in the SSMS Options window:

(1 )Open SSMS -> (2) Click on "Tools" -> (3) Click on "Options..." -> a configuration windows will opened for you

(1)打开SSMS - >(2)点击“工具” - >(3)点击“选项...” - >将打开一个配置窗口

** In this windows we can configure the SSMS setting.

**在此窗口中,我们可以配置SSMS设置。

(4) Go to "Environment" -> (5) go to "International Settings" > and here you can choose all the "Language" from these that your SSMS supported.

(4)转到“环境” - >(5)转到“国际设置”>,在这里您可以选择SSMS支持的所有“语言”。

** If you choose "Same as Microsoft Windows" then it will be influence by the Windows language :-)

**如果您选择“与Microsoft Windows相同”,那么它将受到Windows语言的影响:-)

I hope this is useful :-)

我希望这很有用:-)

#3


0  

Follow the images below to change the Management Studio default language:

按照下面的图像更改Management Studio默认语言:

如何更改SQL Server管理工作室的默认语言?

如何更改SQL Server管理工作室的默认语言?

#1


3  

For the current session just use set language = French.

对于当前会话,只需使用set language = French。

Long term, change the user's language:

长期来看,改变用户的语言:

  • alter login someGuy with default_language = French (<= sql 2008 r2)
  • 使用default_language = French(<= sql 2008 r2)更改登录someGuy

  • alter user someGuy with default_language = French (>=sql 2012)
  • 使用default_language = French(> = sql 2012)更改用户someGuy

http://technet.microsoft.com/en-us/library/ms176060.aspx http://msdn.microsoft.com/en-us/library/ms189828.aspx

I think what you've done above is to change the default language for the database - which will affect the language assigned to new users. For existing users, they would have been created with the original default language, so would need to be updated as above.

我认为您上面所做的是更改数据库的默认语言 - 这将影响分配给新用户的语言。对于现有用户,它们将使用原始默认语言创建,因此需要如上所述进行更新。

This will do it for all users (change login to user if running SQL 2012 or above):

这将为所有用户执行此操作(如果运行SQL 2012或更高版本,则更改登录用户):

declare @l table(sqlCmd nvarchar(max))
declare @sqlCmd nvarchar(max)
insert @l
select 'alter login ' + quotename(loginname) + ' with default_language = French;' from sys.syslogins where language is not null

select top 1 @sqlCmd = sqlcmd from @l
while (@sqlCmd is not null)
begin
    print @sqlCmd
    exec(@sqlCmd)
    update @l set sqlCmd = null where @sqlCmd=sqlCmd
    set @sqlCmd = null  
    select top 1 @sqlCmd = sqlcmd from @l where sqlCmd is not null
end

Changes to a login/user's language will only be seen in new sessions; i.e. if they had a session open before you ran the script their language will be their original default. Ask them to log out and start a new session (or wait for this to happen naturally / kill their current session / restart the db) to ensure they get the new settings.

只有在新会话中才能看到对登录/用户语言的更改;即如果他们在运行脚本之前打开了会话,他们的语言将是他们的原始默认值。让他们注销并开始一个新的会话(或等待自然发生/杀死他们当前的会话/重新启动数据库)以确保他们获得新的设置。

NB: For anyone following this thread, the above answer did not fully solve @SameerPradhan's issue, so he's followed up here: https://dba.stackexchange.com/questions/52402/how-to-change-default-language-of-sql-server-management-studio-2008r2

注意:对于任何关注此主题的人,上述答案并没有完全解决@SameerPradhan的问题,所以他在此处跟进:https://dba.stackexchange.com/questions/52402/how-to-change-default-language-of - SQL服务器管理工​​作室,2008R2

#2


0  

If I understood correctly, your need is to change the language of SQL server management studio and NOT the language of SQL Server instance. Therefore How is it related to queries?!?

如果我理解正确,您需要更改SQL Server管理工作室的语言而不是SQL Server实例的语言。因此,它与查询有什么关系?!?

...

Changing the SSMS configuration is done in the SSMS Options window:

(1 )Open SSMS -> (2) Click on "Tools" -> (3) Click on "Options..." -> a configuration windows will opened for you

(1)打开SSMS - >(2)点击“工具” - >(3)点击“选项...” - >将打开一个配置窗口

** In this windows we can configure the SSMS setting.

**在此窗口中,我们可以配置SSMS设置。

(4) Go to "Environment" -> (5) go to "International Settings" > and here you can choose all the "Language" from these that your SSMS supported.

(4)转到“环境” - >(5)转到“国际设置”>,在这里您可以选择SSMS支持的所有“语言”。

** If you choose "Same as Microsoft Windows" then it will be influence by the Windows language :-)

**如果您选择“与Microsoft Windows相同”,那么它将受到Windows语言的影响:-)

I hope this is useful :-)

我希望这很有用:-)

#3


0  

Follow the images below to change the Management Studio default language:

按照下面的图像更改Management Studio默认语言:

如何更改SQL Server管理工作室的默认语言?

如何更改SQL Server管理工作室的默认语言?