Defines the names of the months and days for an alternate language and its date format.
sp_addlanguage language, alias, months, shortmons, days, datefmt, datefirst
is the official language name for the language, entered in 7-bit ASCII characters only.
substitutes for the alternate language’s official name. Enter either “null”, to make the alias the same as the official language name, or a name you prefer. You can use 8-bit ASCII characters in an alias—”français”, for example—if your terminal supports them.
is a list of the full names of the 12 months, ordered from January through December, separated only by commas (no spaces allowed). Month names can be up to 20 characters long and can contain 8-bit ASCII characters.
is a list of the abbreviated names of the 12 months, ordered from January through December, separated only by commas (no spaces allowed). Month abbreviations can be up to 9 characters long and can contain 8-bit ASCII characters.
is a list of the full names of the seven days, ordered from Monday through Sunday, separated only by commas (no spaces allowed). Day names can be up to 30 characters long and can contain 8-bit ASCII characters.
is the date order of the date parts month/day/year for entering datetime, smalldatetime, date or time data. Valid arguments are mdy, dmy, ymd, ydm, myd, or dym. “dmy” indicates that dates are in day/month/year order.
sets the number of the first weekday for date calculations. For example, Monday is 1, Tuesday is 2, and so on.
This stored procedure adds French to the languages available on the server. “null” makes the alias the same as the official name, “french”. Date order is “dmy” – day/month/year. “1” specifies that lundi, the first item in the days list, is the first weekday. Because the French do not capitalize the names of the days and months except when they appear at the beginning of a sentence, this example shows them being added in lowercase:
sp_addlanguage french, null, "janvier,fevrier,mars,avril,mai,juin,juillet, aout,septembre,octobre,novembre,decembre", "jan,fev,mars,avr,mai,juin,jui,aout,sept,oct, nov,dec", "lundi,mardi,mercredi,jeudi,vendredi,samedi, dimanche", dmy, 1
Usually, you add alternate languages from one of Adaptive Server’s Language Modules using the langinstall utility or the Adaptive Server installation program. A Language Module supplies the names of the dates and translated error messages for that language. However, if a Language Module is not provided with your server, use sp_addlanguage to define the date names and format.
Use sp_modifylogin to change a user’s default language. If you set a user’s default language to a language added with sp_addlanguage, and there are no localization files for the language, the users receive an informational message when they log in, indicating that their client software could not open the localization files.
sp_addlanguage creates an entry in master.dbo.syslanguages, inserting a unique numeric value in the langid column for each alternate language. langid 0 is reserved for U.S. English.
The language parameter becomes the official language name, stored in the name column of master.dbo.syslanguages. Language names must be unique. Use sp_helplanguage to display a list of the alternate languages available on Adaptive Server.
sp_addlanguage sets the alias column in master.dbo.syslanguages to the official language name if NULL is entered for alias, but system administrators can change the value of syslanguage.alias with sp_setlangalias.
sp_addlanguage sets the upgrade column in master.dbo.syslanguages to 0.
For alternate languages added with Language Modules, Adaptive Server sends date values to clients as datetime datatype, and the clients use localization files to display the dates in the user’s current language. For date strings added with sp_addlanguage, use the convert function to convert the dates to character data in the server, where pubdate is datetime data and table is any table:
select convert(char, pubdate) from table
When users perform data entry on date values and need to use date names created with sp_addlanguage, the client must have these values input as character data, and sent to the server as character data.
The permission checks for sp_addlanguage differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be a user with manage server privilege. |
Granular permissions disabled |
With granular permissions disabled, you must be a user with sa_role. |
Values in event and extrainfo columns from the sysaudits table are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
38 |
exec_procedure |
Execution of a procedure |
|
Commands set
System procedures sp_droplanguage, sp_helplanguage, sp_modifylogin, sp_setlangalias