/****************************************************************************************
** Copyright Microsoft, Inc. 1994 - 2000
** All Rights Reserved.
// @File: INSTLANG.SQL
// 
// Purpose:
//   Script for any mkmastr statements that contains non-ascii data
//   e.g., syslanuages & spt_values entries
//
// Notes:
// - This script has to be run with ODBC clients osql or isqlw, after tables syslanguages
//   and spt_values are created in bldmastr.sql/upgrade.sql and u_tables.sql respectively
// - When adding new languages, must 
//     - change x_cLanguages in server code;
//     - Assign the next unused langid
//     - if it's a new message language, add an entry of 'LNG' type to spt_values, otherwise 
//       select an existing message language lcid as msglangid.
//
// History:
//
//   @Version: Sphinx
//   00000 LLH 04/08/98 Created
//
****************************************************************************************/
USE master
go

---- Ensure we can update system catelog tables.
declare  @int1			integer

if (     object_id('sp_configure','P') IS NOT NULL
    AND  1 <> (select value from syscurconfigs where config = 102)
   )
	begin						--Query tree compatible
	exec @int1 = sp_configure 'allow updates',1
	if @@error <> 0 or @int1 <> 0
		raiserror('Bad sp_configure exec at top of Instlang.SQL, killing spid.'
			,22,127) with log
	reconfigure with override
	end
go


---- Make sure server was started in single user mode or that sp_configure was used to enable updates to system tables.

if (select value from syscurconfigs where config = 102) <> 1
	raiserror('Cannot run Instlang.SQL unless updates to system tables are enabled.  Shutdown server and restart with the ''-m'' option or use sp_configure to enable updates to system tables.'
		,22,127) with log
go

-- Populating syslanguages

delete from syslanguages where langid between 0 and 32
go

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(0, N'mdy', 7, 0, N'us_english', N'English', 
		N'January,February,March,April,May,June,July,August,September,October,November,December', 
		N'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec', 
		N'Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday', 1033, 1033)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(1, N'dmy', 1, 0, N'Deutsch',N'German',
		N'Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember',
		N'Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez',
		N'Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag', 1031, 1031)


insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(2, N'dmy', 1, 0, N'Français', N'French',
		N'janvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre',
		N'janv,févr,mars,avr,mai,juin,juil,août,sept,oct,nov,déc',
		N'lundi,mardi,mercredi,jeudi,vendredi,samedi,dimanche',1036, 1036)


insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(3, N'ymd', 7, 0, N'日本語', N'Japanese', 
		N'01,02,03,04,05,06,07,08,09,10,11,12', 
		N'01,02,03,04,05,06,07,08,09,10,11,12', 
		N'月曜,火曜,水曜,木曜,金曜,土曜,日曜', 1041, 1041)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(4, N'dmy', 1, 0,  N'Dansk',N'Danish',
    		N'januar,februar,marts,april,maj,juni,juli,august,september,oktober,november,december',
		N'jan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec',
		N'mandag,tirsdag,onsdag,torsdag,fredag,lordag,sondag', 1030, 1030)


insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(5, N'dmy', 1, 0, N'Español',N'Spanish',
		N'Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre',
		N'Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Sep,Oct,Nov,Dic',
		N'Lunes,Martes,Miércoles,Jueves,Viernes,Sábado,Domingo', 3082, 3082)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(6, N'dmy', 1, 0, N'Italiano',N'Italian',
		N'gennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre',
		N'gen,feb,mar,apr,mag,giu,lug,ago,set,ott,nov,dic',
		N'lunedì,martedì,mercoledì,giovedì,venerdì,sabato,domenica', 1040, 1040)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(7, N'dmy', 1, 0, N'Nederlands',N'Dutch',
		N'januari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december',
		N'jan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec',
		N'maandag,dinsdag,woensdag,donderdag,vrijdag,zaterdag,zondag', 1043, 1043)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(8, N'dmy', 1, 0, N'Norsk',N'Norwegian',
		N'januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember',
		N'jan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des',
		N'mandag,tirsdag,onsdag,torsdag,fredag,laurdag,sundag', 2068, 2068)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(9, N'dmy', 7, 0, N'Português',N'Portuguese',
		N'janeiro,fevereiro,março,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro',
		N'jan,fev,mar,abr,mai,jun,jul,ago,set,out,nov,dez',
		N'segunda-feira,terça-feira,quarta-feira,quinta-feira,sexta-feira,sábado,domingo', 2070, 2070)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(10, N'dmy', 1, 0, N'Suomi',N'Finnish',
		N'tammikuuta,helmikuuta,maaliskuuta,huhtikuuta,toukokuuta,kesäkuuta,heinäkuuta,elokuuta,syyskuuta,lokakuuta,marraskuuta,joulukuuta',
		N'tammi,helmi,maalis,huhti,touko,kesä,heinä,elo,syys,loka,marras,joulu',
		N'maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai,sunnuntai', 1035, 1035)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(11, N'ymd', 1, 0, N'Svenska',N'Swedish',
		N'januari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december',
		N'jan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec',
		N'måndag,tisdag,onsdag,torsdag,fredag,lördag,söndag',1053, 1053)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(12, N'dmy', 1, 0, N'čeština',N'Czech', 
		N'leden,únor,březen,duben,květen,červen,červenec,srpen,září,říjen,listopad,prosinec',
		N'I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII',
		N'pondělí,úterý,středa,čtvrtek,pátek,sobota,neděle', 1029, 1029)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(13, N'ymd', 1, 0, N'magyar', N'Hungarian',
		N'január,február,március,április,május,június,július,augusztus,szeptember,október,november,december',
		N'jan,febr,márc,ápr,máj,jún,júl,aug,szept,okt,nov,dec',
		N'hétfő,kedd,szerda,csütörtök,péntek,szombat,vasárnap', 1038, 1038)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(14, N'dmy', 1, 0, N'polski', N'Polish',
		N'styczeń,luty,marzec,kwiecień,maj,czerwiec,lipiec,sierpień,wrzesień,październik,listopad,grudzień',
		N'I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII',
		N'poniedziałek,wtorek,środa,czwartek,piątek,sobota,niedziela',1045, 1045)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(15, N'dmy', 1, 0, N'română', N'Romanian',
		N'ianuarie,februarie,martie,aprilie,mai,iunie,iulie,august,septembrie,octombrie,noiembrie,decembrie',
		N'Ian,Feb,Mar,Apr,Mai,Iun,Iul,Aug,Sep,Oct,Nov,Dec',
		N'luni,marţi,miercuri,joi,vineri,sîmbătă,duminică', 1048, 1048)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(16, N'ymd', 1, 0, N'hrvatski', N'Croatian',
		N'siječanj,veljača,ožujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac',
		N'sij,vel,ožu,tra,svi,lip,srp,kol,ruj,lis,stu,pro',
		N'ponedjeljak,utorak,srijeda,četvrtak,petak,subota,nedjelja', 1050, 1050)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(17, N'dmy', 1, 0, N'slovenčina', N'Slovak',
		N'január,február,marec,apríl,máj,jún,júl,august,september,október,november,december',
		N'I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII',
		N'pondelok,utorok,streda,štvrtok,piatok,sobota,nedeľa', 1051, 1051)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(18, N'dmy', 1, 0, N'slovenski', N'Slovenian',
		N'januar,februar,marec,april,maj,junij,julij,avgust,september,oktober,november,december',
		N'jan,feb,mar,apr,maj,jun,jul,avg,sept,okt,nov,dec',
		N'ponedeljek,torek,sreda,četrtek,petek,sobota,nedelja', 1060, 1060)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(19, N'dmy', 1, 0,  N'ελληνικά', N'Greek',
		N'Ιανουαρίου,Φεβρουαρίου,Μαρτίου,Απριλίου,Μα_ου,Ιουνίου,Ιουλίου,Αυγούστου,Σεπτεμβρίου,Οκτωβρίου,Νοεμβρίου,Δεκεμβρίου',
		N'Ιαν,Φεβ,Μαρ,Απρ,Μαϊ,Ιουν,Ιουλ,Αυγ,Σεπ,Οκτ,Νοε,Δεκ',
		N'Δευτέρα,Τρίτη,Τετάρτη,Πέμπτη,Παρασκευή,Σάββατο,Κυριακή', 1032, 1032)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(20, N'dmy', 1, 0,   N'български',N'Bulgarian',
		N'януари,февруари,март,апвил,май,юни,юли,август,септември,октомври,ноември,декември',
		N'януари,февруари,март,април,май,юни,юли,август,септември,октомври,ноември,декември',
		N'понеделник,вторник,сряда,четвъвтък,петък,събота,неделя',1026, 1026)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(21, N'dmy', 1, 0,  N'русский',N'Russian',
		N'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь',
		N'янв,фев,мар,апр,май,июн,июл,авг,сен,окт,ноя,дек',
		N'понедельник,вторник,среда,четверг,пятница,суббота,воскресенье', 1049, 1049)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(22, N'dmy', 1, 0, N'Türkçe',  N'Turkish',
		N'Ocak,Şubat,Mart,Nisan,Mayıs,Haziran,Temmuz,Ağustos,Eylül,Ekim,Kasım,Aralık',
		N'Oca,Şub,Mar,Nis,May,Haz,Tem,Ağu,Eyl,Eki,Kas,Ara',
		N'Pazartesi,Salı,Çarşamba,Perşembe,Cuma,Cumartesi,Pazar', 1055, 1055)
go

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) 	values 
		(23, N'dmy', 1, 0, N'British', N'British English', 
		N'January,February,March,April,May,June,July,August,September,October,November,December', 
		N'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec', 
		N'Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday', 2057, 1033)

insert syslanguages (langid, dateformat, datefirst, upgrade, name, alias, months, shortmonths, days, lcid, msglangid)
values (24, N'dmy', 1, 0, N'eesti', N'Estonian',
        N'jaanuar,veebruar,märts,aprill,mai,juuni,juuli,august,september,oktoober,november,detsember',
        N'jaan,veebr,märts,apr,mai,juuni,juuli,aug,sept,okt,nov,dets',
        N'esmaspäev,teisipäev,kolmapäev,neljapäev,reede,laupäev,pühapäev', 1061, 1061)

insert syslanguages (langid, dateformat, datefirst, upgrade, name, alias, months, shortmonths, days, lcid, msglangid)
values (25, N'ymd', 1, 0, N'latviešu', N'Latvian',
        N'janvāris,februāris,marts,aprīlis,maijs,jūnijs,jūlijs,augusts,septembris,oktobris,novembris,decembris',
        N'jan,feb,mar,apr,mai,jūn,jūl,aug,sep,okt,nov,dec',
        N'pirmdiena,otrdiena,trešdiena,ceturtdiena,piektdiena,sestdiena,svētdiena', 1062, 1062)

insert syslanguages (langid, dateformat, datefirst, upgrade, name, alias, months, shortmonths, days, lcid, msglangid)
values (26, N'ymd', 1, 0, N'lietuvių', N'Lithuanian',
        N'sausis,vasaris,kovas,balandis,gegužė,birželis,liepa,rugpjūtis,rugsėjis,spalis,lapkritis,gruodis',
        N'sau,vas,kov,bal,geg,bir,lie,rgp,rgs,spl,lap,grd',
        N'pirmadienis,antradienis,trečiadienis,ketvirtadienis,penktadienis,šeštadienis,sekmadienis', 1063, 1063)


insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) values 
		(27, N'dmy', 7, 0, N'Português (Brasil)', N'Brazilian', 
		N'Janeiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro', 
		N'Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez', 
		N'Segunda-Feira,Terça-Feira,Quarta-Feira,Quinta-Feira,Sexta-Feira,Sábado,Domingo', 1046, 1046)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) values 
		(28, N'ymd', 7, 0, N'繁體中文', N'Traditional Chinese', 
		N'一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月', 
		N'01,02,03,04,05,06,07,08,09,10,11,12', 
		N'星期一,星期二,星期三,星期四,星期五,星期六,星期日', 1028, 1028)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) values 
		(29, N'ymd', 7, 0, N'한국어', N'Korean', 
		N'01,02,03,04,05,06,07,08,09,10,11,12', 
		N'01,02,03,04,05,06,07,08,09,10,11,12', 
		N'월요일,화요일,수요일,목요일,금요일,토요일,일요일', 1042, 1042)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) values 
		(30, N'ymd', 7, 0, N'简体中文', N'Simplified Chinese', 
		N'01,02,03,04,05,06,07,08,09,10,11,12', 
		N'01,02,03,04,05,06,07,08,09,10,11,12', 
		N'星期一,星期二,星期三,星期四,星期五,星期六,星期日', 2052, 2052)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) values 
		(31, N'dmy', 1, 0, N'Arabic', N'Arabic', 
		N'Muharram , Safar , Rabie I  , Rabie II , Jumada I , Jumada II , Rajab , Shaaban , Ramadan , Shawwal , Thou Alqadah , Thou Alhajja', 
		N'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec', 
		N'Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday', 1025, 1025)

insert syslanguages (langid, dateformat, datefirst, upgrade, 
	name, alias, months, shortmonths, days, lcid, msglangid) values 
		(32, N'dmy', 7, 0, N'ไทย', N'Thai', 
		N'มกราคม,กุมภาพันธ์,มีนาคม,เมษายน,พฤษภาคม,มิถุนายน,กรกฎาคม,สิงหาคม,กันยายน,ตุลาคม,พฤศจิกายน,ธันวาคม', 
		N'ม.ค.,ก.พ.,มี.ค.,เม.ย.,พ.ค.,มิ.ย.,ก.ค.,ส.ค.,ก.ย.,ต.ค.,พ.ย.,ธ.ค.', 
		N'จันทร์,อังคาร,พุธ,พฤหัสบดี,ศุกร์,เสาร์,อาทิตย์', 1054, 1054)

go

-- SQL Server message group names stored in spt_values under type "LNG"

delete from spt_values where type = N'LNG'
go

insert into spt_values (name, number, type) values (N'Bulgarian', 1026, N'LNG')

insert into spt_values (name, number, type) values (N'Czech', 1029,  N'LNG')

insert into spt_values (name, number, type) values (N'Danish', 1030,  N'LNG')

insert into spt_values (name, number, type) values (N'German', 1031,  N'LNG')

insert into spt_values (name, number, type) values (N'Greek', 1032, N'LNG')

insert into spt_values (name, number, type) values (N'English', 1033, N'LNG')

insert into spt_values (name, number, type) values (N'Spanish', 3082,  N'LNG')

insert into spt_values (name, number, type) values (N'Finnish', 1035,  N'LNG')

insert into spt_values (name, number, type) values (N'French', 1036,  N'LNG')

insert into spt_values (name, number, type) values (N'Hungarian', 1038,  N'LNG')

insert into spt_values (name, number, type) values (N'Italian', 1040,  N'LNG')

insert into spt_values (name, number, type) values (N'japanese', 1041, N'LNG')

insert into spt_values (name, number, type) values (N'Dutch', 1043,  N'LNG')

insert into spt_values (name, number, type) values (N'Polish', 1045,  N'LNG')

insert into spt_values (name, number, type) values (N'Romanian', 1048,  N'LNG')

insert into spt_values (name, number, type) values (N'Russian', 1049, N'LNG')

insert into spt_values (name, number, type) values (N'Croatian', 1050,  N'LNG')

insert into spt_values (name, number, type) values (N'Slovak', 1051,  N'LNG')

insert into spt_values (name, number, type) values (N'Swedish', 1053,  N'LNG')

insert into spt_values (name, number, type) values (N'Turkish', 1055,  N'LNG')

insert into spt_values (name, number, type) values (N'Slovenian', 1060,  N'LNG')

insert into spt_values (name, number, type) values (N'Norwegian', 2068,  N'LNG')

insert into spt_values (name, number, type) values (N'Portuguese', 2070,  N'LNG')

insert into spt_values (name, number, type) values (N'Estonian', 1061,  N'LNG')
insert into spt_values (name, number, type) values (N'Latvian', 1062,  N'LNG')
insert into spt_values (name, number, type) values (N'Lithuanian', 1063,  N'LNG')
insert into spt_values (name, number, type) values (N'Brazilian', 1046,  N'LNG')
insert into spt_values (name, number, type) values (N'Traditional Chinese', 1028,  N'LNG')
insert into spt_values (name, number, type) values (N'Korean', 1042,  N'LNG')
insert into spt_values (name, number, type) values (N'Simplified Chinese', 2052,  N'LNG')
insert into spt_values (name, number, type) values (N'Arabic', 1025,  N'LNG')
insert into spt_values (name, number, type) values (N'Thai', 1054,  N'LNG')
go


if object_id('sp_configure','P') IS NOT NULL
	begin
		exec sp_configure 'allow updates',0
		reconfigure with override
	end
go

