SQL Set Language Transact-SQL 設置國家語言

http://technet.microsoft.com/en-us/library/aa259215%28SQL.80%29.aspx
http://www.sqlusa.com/bestpractices/setdefaultlanguage/
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=59051
http://msdn.microsoft.com/en-us/library/ms187335.aspx
http://msdn.microsoft.com/en-us/library/aa259642%28v=sql.80%29.aspx

-- Setting default language for login

use master

EXEC sp_defaultlanguage 'kimberlyhay', 'us_english'

GO

-- SQL Server 2005 and onward

ALTER LOGIN kimberlyhay WITH DEFAULT_LANGUAGE = British;

GO

-- Get languages information

EXEC sp_helplanguage

------------

-- Languages in SQL Server 2008 with dateformat

SELECT LanguageID = langid,

       name,

       alias,

       dateformat

FROM     sys.syslanguages

ORDER BY langid

GO

-- Results
LanguageID 	name 	alias 	dateformat
0 	us_english 	English 	mdy
1 	Deutsch 	German 	dmy
2 	Fran?ais 	French 	dmy
3 	日本語 	Japanese 	ymd
4 	Dansk 	Danish 	dmy
5 	Espa?ol 	Spanish 	dmy
6 	Italiano 	Italian 	dmy
7 	Nederlands 	Dutch 	dmy
8 	Norsk 	Norwegian 	dmy
9 	Português 	Portuguese 	dmy
10 	Suomi 	Finnish 	dmy
11 	Svenska 	Swedish 	ymd
12 	?e?tina 	Czech 	dmy
13 	magyar 	Hungarian 	ymd
14 	polski 	Polish 	dmy
15 	rom?n? 	Romanian 	dmy
16 	hrvatski 	Croatian 	ymd
17 	sloven?ina 	Slovak 	dmy
18 	slovenski 	Slovenian 	dmy
19 	ελληνικ? 	Greek 	dmy
20 	български 	Bulgarian 	dmy
21 	русский 	Russian 	dmy
22 	Türk?e 	Turkish 	dmy
23 	British 	British English 	dmy
24 	eesti 	Estonian 	dmy
25 	latvie?u 	Latvian 	ymd
26 	lietuvi? 	Lithuanian 	ymd
27 	Português (Brasil) 	Brazilian 	dmy
28 	繁體中文 	Traditional Chinese 	ymd
29 	??? 	Korean 	ymd
30 	简体中文 	Simplified Chinese 	ymd
31 	Arabic 	Arabic 	dmy
32 	??? 	Thai 	dmy

------------

 --季度
select datename(quarter,getdate())
--季度
select DATEPART(quarter,getdate()) -- Setting default database for login EXEC sp_defaultdb 'kimberlyhay', 'AdventureWorks' -- SQL Server 2005 and SQL Server 2008 ALTER LOGIN kimberlyhay WITH DEFAULT_DATABASE = AdventureWorks2008; ------------顯示各國語言的星期幾(2000,2005,2008版本支持)Geovin Du 塗聚文注 --顯示語言周幾 SET LANGUAGE swedish select datename(weekday,getdate()) -- SET LANGUAGE 简体中文 select datename(weekday,getdate())
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Transact-SQL In Chapter 20, you builtSQL statements to retrieve and update rows in a database. You also learned all the variations of the SELECT statement. Some restrictions, however, can’t be expressed with a WHERE clause, no matter how complicated. To perform complicated searches, many programmers would rather write an application to retrieve the desired rows, process them, and then display some results. The processing could include running totals, formatting of the query’s output, calculations involving multiple rows of the same table, and so on. Most database management systems include extensions, which enhance SQL and make it behave more like a programming language. SQL Server provides a set of statements known as Transact-SQL (T-SQL). T-SQL recognizes statements that fetch rows from one or more tables, flow-control statements like IF…ELSE and WHILE, and numerous functions to manipulate strings, numeric values, and dates, similar to Visual Basic’s functions. With T-SQL you can do everything that can be done with SQL, as well as program these operations. At the very least, you can attach lengthy SQL statements to a database as stored procedures, so that you can call them by name. In addition, you can use parameters, so that the same procedure can act on different data. This chapter is an overview of T-SQL and demonstrates the basic topic with stored proce- dures that perform complicated tasks on the server. We’ll start with the COMPUTE BY state- ment, which allows you to calculate totals on groups of the rows retrieved from the database. This statement looks and feels very much like the straight SQL statements, yet it’s not part of standard SQL. Then we’ll look at T-SQL in depth. If you need to look up a function or how to declare a stored procedure’s arguments, you can use this chapter as reference material. If you’re new to T-SQL, you should read this material, because T-SQL is a powerful language, and if you’re working with or plan to switch to SQL Server, you’ll need it sooner or later. In addition, you’ll improve your Visual Basic programming. T-SQL is the native language of SQL Server. By seeing how the basic operations can be implemented in T-SQL and VB, you’ll gain a deeper under- standing of database programming.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值