Database | Proc | Application | Created | Links |
sybsystemprocs | sp_helplanguage | 31 Aug 14 | Defects Dependencies |
1 2 /* Sccsid = "%Z% generic/sproc/src/%M% %I% %G%" */ 3 /* 4.8 1.1 06/14/90 sproc/src/fixindex */ 4 /* 5 ** Messages for "sp_helplanguage" 17670 6 ** 7 ** 17201, "'%1!' is not an official language name from Syslanguages." 8 ** 17670, "No alternate languages are available." 9 ** 17671, "us_english is always available, even though it is not in 10 ** master.dbo.syslanguages." 11 */ 12 create procedure sp_helplanguage 13 @language varchar(255) = NULL 14 as 15 16 declare @msg varchar(1024) 17 declare @retval int 18 19 20 if @@trancount = 0 21 begin 22 set chained off 23 end 24 25 set transaction isolation level 1 26 27 /* Print all languages if the user didn't give the language name. */ 28 if @language is null 29 begin 30 if exists (select * from master.dbo.syslanguages) 31 begin 32 /* Adaptive Server has expanded all '*' elements in the following statement */ select master.dbo.syslanguages.langid, master.dbo.syslanguages.dateformat, master.dbo.syslanguages.datefirst, master.dbo.syslanguages.upgrade, master.dbo.syslanguages.name, master.dbo.syslanguages.alias, master.dbo.syslanguages.months, master.dbo.syslanguages.shortmonths, master.dbo.syslanguages.days into #syslanguages1 from master.dbo.syslanguages 33 exec @retval = sp_autoformat #syslanguages1 34 drop table #syslanguages1 35 if (@retval != 0) 36 return 1 37 end 38 else 39 begin 40 /* 17670, "No alternate languages are available." */ 41 exec sp_getmessage 17670, @msg out 42 print @msg 43 end 44 45 /* Find out whether us_english is there or not. */ 46 if not exists (select * from master.dbo.syslanguages 47 where name = 'us_english') 48 begin 49 /* 50 ** 17671, "us_english is always available, even though it 51 ** is not in master.dbo.syslanguages." 52 */ 53 exec sp_getmessage 17671, @msg out 54 print @msg 55 end 56 return 0 57 end 58 59 /* Report information on this language. */ 60 if exists (select * from master.dbo.syslanguages 61 where name = @language) 62 begin 63 /* Adaptive Server has expanded all '*' elements in the following statement */ select master.dbo.syslanguages.langid, master.dbo.syslanguages.dateformat, master.dbo.syslanguages.datefirst, master.dbo.syslanguages.upgrade, master.dbo.syslanguages.name, master.dbo.syslanguages.alias, master.dbo.syslanguages.months, master.dbo.syslanguages.shortmonths, master.dbo.syslanguages.days into #syslanguages2 from master.dbo.syslanguages 64 where name = @language 65 exec @retval = sp_autoformat #syslanguages2 66 drop table #syslanguages2 67 if (@retval != 0) 68 return 1 69 70 return 0 71 end 72 73 if exists (select * from master.dbo.syslanguages 74 where alias = @language) 75 begin 76 /* Adaptive Server has expanded all '*' elements in the following statement */ select master.dbo.syslanguages.langid, master.dbo.syslanguages.dateformat, master.dbo.syslanguages.datefirst, master.dbo.syslanguages.upgrade, master.dbo.syslanguages.name, master.dbo.syslanguages.alias, master.dbo.syslanguages.months, master.dbo.syslanguages.shortmonths, master.dbo.syslanguages.days into #syslanguages3 from master.dbo.syslanguages 77 where alias = @language 78 exec @retval = sp_autoformat #syslanguages3 79 drop table #syslanguages3 80 if (@retval != 0) 81 return 1 82 83 return 0 84 end 85 86 /* Couldn't find this language. */ 87 if @language = 'us_english' 88 begin 89 /* 90 ** 17671, "us_english is always available, even though it is not in 91 ** master.dbo.syslanguages." 92 */ 93 exec sp_getmessage 17671, @msg out 94 print @msg 95 return 0 96 end 97 else 98 begin 99 /* 17201, "'%1!' is not an official language name from Syslanguages." */ 100 raiserror 17201, @language 101 return 1 102 end 103
exec sp_procxmode 'sp_helplanguage', 'AnyMode' go Grant Execute on sp_helplanguage to public go
DEPENDENCIES |
PROCS AND TABLES USED calls proc sybsystemprocs..sp_autoformat reads table master..systypes (1) reads table tempdb..syscolumns (1) read_writes table tempdb..#colinfo_af (1) calls proc sybsystemprocs..sp_autoformat reads table master..syscolumns (1) reads table tempdb..systypes (1) calls proc sybsystemprocs..sp_namecrack calls proc sybsystemprocs..sp_getmessage reads table sybsystemprocs..sysusermessages reads table master..sysmessages (1) calls proc sybsystemprocs..sp_validlang reads table master..syslanguages (1) reads table master..syslanguages (1) writes table tempdb..#syslanguages2 (1) writes table tempdb..#syslanguages3 (1) reads table master..syslanguages (1) writes table tempdb..#syslanguages1 (1) |