Sep 30, 2013

SET LANGUAGE failed because '' is not an official language name or a language alias on this SQL Server

If we will create a very simple natively complied stored procedure in the sql server 2014:

CREATE PROCEDUREuspGetEmployee
WITH NATIVE_COMPILATION,SCHEMABINDING,EXECUTE AS OWNER
AS
BEGIN ATOMICWITH(TRANSACTION ISOLATIONLEVEL = SNAPSHOT,LANGUAGE = N'uk')
     SELECT 'Simple Procedure'
END

We may get following error message:

SET LANGUAGE failed because '' is not an official language name or a language alias on this SQL Server.

Cause: Language we have specified while creating natively compiled stored procedure is not supported by sql server 2014.

Solution: We can get the list of all sported languages in sql server 2014 by following script:

SELECT name,alias FROM sys.syslanguages

List of supported languages:
Name
Alias
us_english
English
Deutsch
German
Français
French
日本語
Japanese
Dansk
Danish
Español
Spanish
Italiano
Italian
Nederlands
Dutch
Norsk
Norwegian
Português
Portuguese
Suomi
Finnish
Svenska
Swedish
čeština
Czech
magyar
Hungarian
polski
Polish
română
Romanian
hrvatski
Croatian
slovenčina
Slovak
slovenski
Slovenian
ελληνικά
Greek
български
Bulgarian
русский
Russian
Türkçe
Turkish
British
British English
eesti
Estonian
latviešu
Latvian
lietuvių
Lithuanian
Português (Brasil)
Brazilian
繁體中文
Traditional Chinese
한국어
Korean
体中文
Simplified Chinese
Arabic
Arabic
ไทย
Thai
norsk (bokmål)
Bokmål
name
alias

So we can specify either language name or alias name. For example:

CREATE PROCEDUREuspGetEmployee
WITH NATIVE_COMPILATION,SCHEMABINDING,EXECUTE AS OWNER
AS
BEGIN ATOMICWITH(TRANSACTION ISOLATIONLEVEL = SNAPSHOT,LANGUAGE = N'us_english')
    
     SELECT 'Simple Procedure'

END

Or

CREATE PROCEDUREuspGetEmployee
WITH NATIVE_COMPILATION,SCHEMABINDING,EXECUTE AS OWNER
AS
BEGIN ATOMICWITH(TRANSACTION ISOLATIONLEVEL = SNAPSHOT,LANGUAGE = N'English')
    
     SELECT 'Simple Procedure'


END

No comments:

Post a Comment