日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区

您的位置:首頁技術文章
文章詳情頁

SQL Server的Collate語句需注意

瀏覽:274日期:2023-10-31 10:32:57

汗,今天被Sql Server的Collate子句大玩了一把,看在線幫助不仔細!讓自己繞了一個大圈,以后看MS幫助可要仔細了,事情是這樣的:下午,老大給我們發來一段SQL Script,要我們測試,看有沒有錯誤,如有,請提出!整個Script全部在這里!我當時就將這段腳本拉進了查詢分析器,一執行,呵呵,根本沒錯啊!那老大為什么要發這樣的郵件出來呢?于是我又切換了幾個database,也沒有什么問題,正當我準備測試完這一個database就放棄測試退出的時候,問題來了。錯誤消息如下:Server: Msg 446, Level 16, State 9, Line 61Cannot resolve collation conflict for equal to operation.呵呵,有困難,找警察,咱有難,就找online啦。按下F1,鍵入collation,最后定位至See also中的Collate,查到幫助文件如下(不好意思,我只是將sql server2000 的在線幫助源封不動的復制了一下,當然在我當時沒有看仔細的那一句我變換了顏色,各位朋友也請不要犯同樣的錯誤為好。呵呵):

COLLATEA clause that can be applied to a database definition or a column definition to define the collation, or to a character string expression to apply a collation cast.

SyntaxCOLLATE < collation_name >

< collation_name > :: = { Windows_collation_name } | { SQL_collation_name }

Argumentscollation_name

Is the name of the collation to be applied to the expression, column definition, or database definition. collation_name can be only a specified Windows_collation_name or a SQL_collation_name.

Windows_collation_name Is the collation name for Windows collation. See Windows Collation Names.

SQL_collation_name Is the collation name for a SQL collation. See SQL Collation Names. RemarksThe COLLATE clause can be specified at several levels, including the following:

Creating or altering a database. You can use the COLLATE clause of the CREATE DATABASE or ALTER DATABASE statement to specify the default collation of the database. You can also specify a collation when you create a database using SQL Server Enterprise Manager. If you do not specify a collation, the database is assigned the default collation of the SQL Server instance.

Creating or altering a table column. You can specify collations for each character string column using the COLLATE clause of the CREATE TABLE or ALTER TABLE statement. You can also specify a collation when you create a table using SQL Server Enterprise Manager. If you do not specify a collation, the column is assigned the default collation of the database.

You can also use the database_default option in the COLLATE clause to specify that a column in a temporary table use the collation default of the current user database for the connection instead of tempdb.

Casting the collation of an expression. You can use the COLLATE clause to cast a character expression to a certain collation. Character literals and variables are assigned the default collation of the current database. Column references are assigned the definition collation of the column.; For the collation of an expression, see Collation Precedence.

The collation of an identifier depends on the level at which it is defined. Identifiers of instance-level objects, such as logins and database names, are assigned the default collation of the instance. Identifiers of objects within a database, such as tables, views, and column names, are assigned the default collation of the database. For example, two tables with names differing only in case may be created in a database with case-sensitive collation, but may not be created in a database with case-insensitive collation.

Variables, GOTO labels, temporary stored procedures, and temporary tables can be created when the connection context is associated with one database, and then referenced when the context has been switched to another database. The identifiers for variables, GOTO labels, temporary stored procedures, and temporary tables are in the default collation of the instance.

The COLLATE clause can be applied only for the char, varchar, text, nchar, nvarchar, and ntext data types.

Collations are generally identified by a collation name. The exception is in Setup where you do not specify a collation name for Windows collations, but instead specify the collation designator, and then select check boxes to specify binary sorting or dictionary sorting that is either sensitive or insensitive to either case or accents.

You can execute the system function fn_helpcollations to retrieve a list of all the valid collation names for Windows collations and SQL collations:

SELECT *FROM ::fn_helpcollations()SQL Server can support only code pages that are supported by the underlying operating system. When you perform an action that depends on collations, the SQL Server collation used by the referenced object must use a code page supported by the operating system running on the computer. These actions can include:

Specifying a default collation for a database when you create or alter the database.

Specifying a collation for a column when creating or altering a table.

When restoring or attaching a database, the default collation of the database and the collation of any char, varchar, and text columns or parameters in the database must be supported by the operating system. Code page translations are supported for char and varchar data types, but not for text data type. Data loss during code page translations is not reported.

If the collation specified or the collation used by the referenced object, uses a code page not supported by Windows®, SQL Server issues error. For more information, see the Collations section in the SQL Server Architecture chapter of the SQL Server Books Online.

當時,我承認,我確實大致看完了全篇了,心里明白是排序規則的原因,導致了錯誤信息的出現。使用collate語句強制指定排序規則是可以解決的,于是我在老大的代碼上的每個字串類型的字段后面都加上了 collate Chinese_PRC_CI_AS; ,然后F5運行,faint...,問題照舊。于是改為:collate SQL_Latin1_General_CP1_CI_AS,嗯,問題解決,正當以為就這樣可以解決的時候,我又試了一下沒加之前沒錯的database,faint...,他們出現了同樣的錯誤信息,難道是拆東墻補西墻。不行, 問題沒有解決,于是,我也上QQ群發問了,也不知是因為今天是周末還是什么原因,總之沒有一個人回答我。最后實在沒有辦法,只好自己再回來看上面那段其實我并不喜歡的幫助啦(因為是英文嘛!呵呵...),當我看到

You can also use the database_default option in the COLLATE clause to specify that a column in a temporary table use the collation default of the current user database for the connection instead of tempdb.

著實把我喜了一把。馬上改用collate database_default,嗯,一個通過、兩個通過、三個通過....OK,終于解決,松了一口氣。

將這件事post上來,一是對自己作個警示:以后看幫助真的要仔細點。二是希望朋友不要犯類似的低級錯誤,以免浪費無謂的時間。如果要查看源碼sql script,請點擊這里下載。是提取database的屬性的哦。

標簽: Sql Server 數據庫
日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区
久久高清免费| 国产精品高清一区二区| 激情综合五月| 日韩av一区二区三区四区| 视频国产精品| 91精品国产经典在线观看| 日韩在线黄色| 国产精品网址| 日本不良网站在线观看| 99久久99久久精品国产片果冰 | 日本午夜精品久久久久| 欧美日韩午夜电影网| 国产精品一级| 三上悠亚国产精品一区二区三区 | 国产精品久久久亚洲一区| 免费精品一区| 99成人超碰| 先锋亚洲精品| 国产精品久久久久久久久久齐齐 | 日韩在线免费| 先锋影音久久久| 国产日韩欧美在线播放不卡| 精品一级视频| 9色精品在线| 欧美日韩亚洲一区三区| 国产精品a级| 欧美福利专区| 久久精品99国产精品日本| www.九色在线| 亚洲自拍另类| 激情中国色综合| 亚洲欧美久久久| 精品久久福利| 日韩中文字幕区一区有砖一区 | 欧美日本久久| 成午夜精品一区二区三区软件| 激情偷拍久久| 91大神在线观看线路一区| 麻豆成全视频免费观看在线看| 日韩一级不卡| 精品久久久网| 亚洲精品极品| av资源亚洲| 青青草国产精品亚洲专区无| 日韩免费看片| 日本少妇精品亚洲第一区| 日韩天堂在线| 国产亚洲一区二区三区啪| 99久久激情| 国产精品乱战久久久| 色综合www| 国产欧美日韩免费观看| 中文亚洲免费| www成人在线视频| 国产经典一区| 在线免费观看亚洲| 亚洲va中文在线播放免费| 国产欧美成人| 日韩一区精品视频| 久久国产影院| 麻豆免费精品视频| 亚洲永久精品唐人导航网址| 久久毛片亚洲| 欧美国产专区| 日韩av午夜在线观看| 精品一区毛片| 久久久久久一区二区| 日韩av网站在线免费观看| 亚洲精品小说| 最新中文字幕在线播放| 国产精品videossex久久发布| 亚洲一区二区动漫| 99久久夜色精品国产亚洲1000部| 精品国产a一区二区三区v免费| 日本一区福利在线| 日韩影院精彩在线| 亚洲一区国产| 国产综合视频| 日本精品影院| 视频福利一区| bbw在线视频| 动漫av一区| 麻豆一区在线| 精品亚洲免a| 国内在线观看一区二区三区| 国产探花一区| 日韩av在线免费观看不卡| 日韩在线一区二区| 美女久久网站| 香蕉久久夜色精品国产| 久久aⅴ国产紧身牛仔裤| av不卡在线看| 日韩精品一级中文字幕精品视频免费观看 | 久久国产电影| 久久国产中文字幕| 国内精品99| 欧美日韩精品一区二区视频| 香蕉视频亚洲一级| 色爱综合av| 在线日韩欧美| 欧美日韩国产免费观看| 国产高清久久| 亚洲欧美日韩国产一区二区| 日韩一级精品| 中文字幕日韩亚洲| 少妇精品久久久一区二区三区| 中文字幕一区二区三区四区久久| 影音先锋久久精品| 奇米亚洲欧美| 国产欧美久久一区二区三区| 国产精品日本一区二区不卡视频 | 国产欧洲在线| 私拍精品福利视频在线一区| 极品裸体白嫩激情啪啪国产精品| 国产 日韩 欧美一区| 日韩国产一区二区| 日韩av福利| 夜夜嗨一区二区三区| 伊人久久亚洲美女图片| 视频一区视频二区中文| 国产亚洲欧美日韩精品一区二区三区 | 欧美欧美黄在线二区| 国产精品高清一区二区| 国产成人精品一区二区三区在线| 欧美日韩视频免费观看| 欧美日韩国产综合网| 午夜在线观看免费一区| 日韩av一区二| bbw在线视频| 九九在线精品| 日韩av一区二区三区四区| 日本不良网站在线观看| 久久亚洲欧美| 精品视频在线一区二区在线| av资源亚洲| 亚洲欧美日韩国产一区| 国产日产精品_国产精品毛片 | 国产精品成人自拍| 国产福利片在线观看| 自由日本语亚洲人高潮| 日韩精选在线| 国产69精品久久| 久久亚洲一区| 国产精品久久久久久久久久白浆 | 国产一区丝袜| 欧美日韩国产欧| 国产精品啊啊啊| 夜夜嗨网站十八久久| 欧美片第1页综合| 欧美va天堂| 欧美精品aa| 美国三级日本三级久久99 | 伊人久久亚洲| 国内不卡的一区二区三区中文字幕| 欧美精品高清| 久久精品99国产国产精| 激情丁香综合| 久久精品国产福利| 男人操女人的视频在线观看欧美| 老司机精品在线| 丝袜美腿亚洲一区二区图片| 久久精品二区亚洲w码| 久久aⅴ国产紧身牛仔裤| 国产中文字幕一区二区三区| 国产免费成人| 在线一区av| 国产精品中文字幕制服诱惑| 999国产精品999久久久久久| 日本天堂一区| 亚洲国产一区二区在线观看 | а√天堂8资源中文在线| 亚洲人成精品久久久| 亚洲成a人片| 欧美激情精品| 亚洲欧美日本国产| 人人精品亚洲| 国产中文字幕一区二区三区| 日韩精品免费观看视频| 麻豆网站免费在线观看| 综合一区av| 狠狠干综合网| 日韩成人综合| 成人午夜在线| 国产激情久久| 久久狠狠亚洲综合| 少妇精品久久久| 蜜桃久久久久久| 女人天堂亚洲aⅴ在线观看| 中文av在线全新| 精品免费av| 欧美国产另类| 欧美精品1区| 欧美日韩一区自拍| 男人天堂欧美日韩| 99国产精品视频免费观看一公开 | 久久精品国产999大香线蕉| 欧美亚洲综合视频| 日韩二区三区在线观看| 蜜臀av一区二区三区| 99国产精品视频免费观看一公开 |