SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 Language Country Name and Server Info
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

harlingtonthewizard
Constraint Violating Yak Guru

Australia
352 Posts

Posted - 09/22/2009 :  00:32:17  Show Profile  Reply with Quote
USE [VC]
GO
/****** Object: StoredProcedure [dbo].[Server_Info] Script Date: 09/22/2009 13:57:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Steve Harlington
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[Server_Info]

As

SET NOCOUNT ON

Declare @Lang nvarchar(100)
Declare @Type sql_variant
Declare @Type1 nvarchar(100)

SET @Type = (Select ServerProperty ('LCID') As LanguageCountryID)
SET @Type1 = (Select Convert(nvarchar(100), @Type)As LanguageCountryID)

--Print @Type1

SET @Lang = (
CASE
When @Type1 = '1078' Then 'Afrikaans'
When @Type1 = '1052' Then 'Albanian'
When @Type1 = '14337' Then 'Arabic - United Arab Emirates'
When @Type1 = '15361' Then 'Arabic - Bahrain'
When @Type1 = '5121' Then 'Arabic - Algeria'
When @Type1 = '3073' Then 'Arabic - Egypt'
When @Type1 = '2049' Then 'Arabic - Iraq'
When @Type1 = '11265' Then 'Arabic - Jordan'
When @Type1 = '13313' Then 'Arabic - Kuwait'
When @Type1 = '12289' Then 'Arabic - Lebanon'
When @Type1 = '4097' Then 'Arabic - Libya'
When @Type1 = '6145' Then 'Arabic - Morocco'
When @Type1 = '8193' Then 'Arabic - Oman'
When @Type1 = '16385' Then 'Arabic - Qatar'
When @Type1 = '1025' Then 'Arabic - Saudi Arabia'
When @Type1 = '10241' Then 'Arabic - Syria'
When @Type1 = '7169' Then 'Arabic - Tunisia'
When @Type1 = '9217' Then 'Arabic - Yemen'
When @Type1 = '1067' Then 'Armenian'
When @Type1 = '1068' Then 'Azeri - Latin'
When @Type1 = '2092' Then 'Azeri - Cyrillic'
When @Type1 = '1069' Then 'Basque'
When @Type1 = '1059' Then 'Belarusian'
When @Type1 = '1026' Then 'Bulgarian'
When @Type1 = '1027' Then 'Catalan'
When @Type1 = '2052' Then 'Chinese - China'
When @Type1 = '3076' Then 'Chinese - Hong Kong SAR'
When @Type1 = '5124' Then 'Chinese - Macau SAR'
When @Type1 = '4100' Then 'Chinese - Singapore'
When @Type1 = '1028' Then 'Chinese - Taiwan'
When @Type1 = '1050' Then 'Croatian'
When @Type1 = '1029' Then 'Czech'
When @Type1 = '1030' Then 'Danish'
When @Type1 = '1043' Then 'Dutch - Netherlands'
When @Type1 = '2067' Then 'Dutch - Belgium'
When @Type1 = '3081' Then 'English - Australia'
When @Type1 = '10249' Then 'English - Belize'
When @Type1 = '4105' Then 'English - Canada'
When @Type1 = '9225' Then 'English - Caribbean'
When @Type1 = '6153' Then 'English - Ireland'
When @Type1 = '8201' Then 'English - Jamaica'
When @Type1 = '5129' Then 'English - New Zealand'
When @Type1 = '13321' Then 'English - Phillippines'
When @Type1 = '7177' Then 'English - Southern Africa'
When @Type1 = '11273' Then 'English - Trinidad'
When @Type1 = '2057' Then 'English - Great Britain'
When @Type1 = '1033' Then 'English - United States'
When @Type1 = '1061' Then 'Estonian'
When @Type1 = '1065' Then 'Farsi'
When @Type1 = '1035' Then 'Finnish'
When @Type1 = '1080' Then 'Faroese'
When @Type1 = '1036' Then 'French - France'
When @Type1 = '2060' Then 'French - Belgium'
When @Type1 = '3084' Then 'French - Canada'
When @Type1 = '5132' Then 'French - Luxembourg'
When @Type1 = '4108' Then 'French - Switzerland'
When @Type1 = '2108' Then 'Gaelic - Ireland'
When @Type1 = '1084' Then 'Gaelic - Scotland'
When @Type1 = '1031' Then 'German - Germany'
When @Type1 = '3079' Then 'German - Austria'
When @Type1 = '5127' Then 'German - Liechtenstein'
When @Type1 = '4103' Then 'German - Luxembourg'
When @Type1 = '2055' Then 'German - Switzerland'
When @Type1 = '1032' Then 'Greek'
When @Type1 = '1037' Then 'Hebrew'
When @Type1 = '1081' Then 'Hindi'
When @Type1 = '1038' Then 'Hungarian'
When @Type1 = '1039' Then 'Icelandic'
When @Type1 = '1057' Then 'Indonesian'
When @Type1 = '1040' Then 'Italian - Italy'
When @Type1 = '2064' Then 'Italian - Switzerland'
When @Type1 = '1041' Then 'Japanese'
When @Type1 = '1042' Then 'Korean'
When @Type1 = '1062' Then 'Latvian'
When @Type1 = '1063' Then 'Lithuanian'
When @Type1 = '1071' Then 'F.Y.R.O. Macedonia'
When @Type1 = '1086' Then 'Malay - Malaysia'
When @Type1 = '2110' Then 'Malay – Brunei'
When @Type1 = '1082' Then 'Maltese'
When @Type1 = '1102' Then 'Marathi'
When @Type1 = '1044' Then 'Norwegian - Bokml'
When @Type1 = '2068' Then 'Norwegian - Nynorsk'
When @Type1 = '1045' Then 'Polish'
When @Type1 = '2070' Then 'Portuguese - Portugal'
When @Type1 = '1046' Then 'Portuguese - Brazil'
When @Type1 = '1047' Then 'Raeto-Romance'
When @Type1 = '1048' Then 'Romanian - Romania'
When @Type1 = '2072' Then 'Romanian - Republic of Moldova'
When @Type1 = '1049' Then 'Russian'
When @Type1 = '2073' Then 'Russian - Republic of Moldova'
When @Type1 = '1103' Then 'Sanskrit'
When @Type1 = '3098' Then 'Serbian - Cyrillic'
When @Type1 = '2074' Then 'Serbian - Latin'
When @Type1 = '1074' Then 'Setsuana'
When @Type1 = '1060' Then 'Slovenian'
When @Type1 = '1051' Then 'Slovak'
When @Type1 = '1070' Then 'Sorbian'
When @Type1 = '1034' Then 'Spanish - Spain (Traditional)'
When @Type1 = '11274' Then 'Spanish - Argentina'
When @Type1 = '16394' Then 'Spanish - Bolivia'
When @Type1 = '13322' Then 'Spanish - Chile'
When @Type1 = '9226' Then 'Spanish - Colombia'
When @Type1 = '5130' Then 'Spanish - Costa Rica'
When @Type1 = '7178' Then 'Spanish - Dominican Republic'
When @Type1 = '12298' Then 'Spanish - Ecuador'
When @Type1 = '4106' Then 'Spanish - Guatemala'
When @Type1 = '18442' Then 'Spanish - Honduras'
When @Type1 = '2058' Then 'Spanish - Mexico'
When @Type1 = '19466' Then 'Spanish - Nicaragua'
When @Type1 = '6154' Then 'Spanish - Panama'
When @Type1 = '10250' Then 'Spanish - Peru'
When @Type1 = '20490' Then 'Spanish - Puerto Rico'
When @Type1 = '15370' Then 'Spanish - Paraguay'
When @Type1 = '17418' Then 'Spanish - El Salvador'
When @Type1 = '14346' Then 'Spanish - Uruguay'
When @Type1 = '8202' Then 'Spanish - Venezuela'
When @Type1 = '1072' Then 'Southern Sotho'
When @Type1 = '1089' Then 'Swahili'
When @Type1 = '1053' Then 'Swedish - Sweden'
When @Type1 = '2077' Then 'Swedish - Finland'
When @Type1 = '1097' Then 'Tamil'
When @Type1 = '1092' Then 'Tatar'
When @Type1 = '1054' Then 'Thai'
When @Type1 = '1055' Then 'Turkish'
When @Type1 = '1073' Then 'Tsonga'
When @Type1 = '1058' Then 'Ukrainian'
When @Type1 = '1056' Then 'Urdu'
When @Type1 = '2115' Then 'Uzbek - Cyrillic'
When @Type1 = '1091' Then 'Uzbek – Latin'
When @Type1 = '1066' Then 'Vietnamese '
When @Type1 = '1076' Then 'Xhosa'
When @Type1 = '1085' Then 'Yiddish'
When @Type1 = '1077' Then 'Zulu'
END )

--Print @Lang

Select (@Lang) As LanguageCountryID,
ServerProperty ('MachineName') As MachineName,
ServerProperty ('ServerName') As ServerName,
ServerProperty ('ProductVersion') As ProductVersion,
ServerProperty ('ProductLevel') As ProductLevel,
ServerProperty ('Edition') As Edition,
ServerProperty ('EditionID') As EditionID,
ServerProperty ('EngineEdition') As EngineEdition,
ServerProperty ('Collation') As Collation,
ServerProperty ('ComputerNamePhysicalNetBIOS') As ComputerNamePhysicalNetBIOS,
ServerProperty ('InstanceName') As InstanceName,
ServerProperty ('IsClustered') As IsClustered,
ServerProperty ('IsFulltextInstalled') As IsFulltextInstalled,
ServerProperty ('IsIntegratedSecurityOnly') As IsIntegratedSecurityOnly,
ServerProperty ('IsSingleUser') As IsSingleUser,
ServerProperty ('LicenseType') As LicenseType,
ServerProperty ('NumLicenses') As NumLicenses,
ServerProperty ('ProcessID') As SQLServerProcessID,
ServerProperty ('ResourceLastUpdateDateTIme') As ResourceLastUpdateDateTIme,
ServerProperty ('ResourceVersion') As ResourceVersion,
ServerProperty ('BuildCLRVersion') As BuildCLRVersion,
ServerProperty ('LCID') As LCID,
DatabasePropertyEX ('VC', 'Status') AS VCDatabaseStatus,
DatabasePropertyEX ('VC', 'UserAccess') AS VCDatabaseUserAccess,
DatabasePropertyEX ('VC', 'Collation') AS VCDatabaseCollation,
DatabasePropertyEX ('VCLog', 'Status') AS VCLogDatabaseStatus,
DatabasePropertyEX ('VCLog', 'UserAccess') AS VCLogDatabaseUserAccess,
DatabasePropertyEX ('VCLog', 'Collation') AS VCLogDatabaseCollation,
Session_User As SessionUser

SET NOCOUNT OFF

RETURN

madhivanan
Premature Yak Congratulator

India
22761 Posts

Posted - 09/22/2009 :  03:55:09  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
1 USE [VC] is not neccessary as you expect others to create that database
2 ALTER procedure should be CREATE Procedure (Otherwsie whoever runs the code will get an error saying Invalid Object name)


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000