SQL取字段型別

2021-04-17 13:29:44 字數 795 閱讀 6640

存於每乙個資料庫的syscolumns表裡面的name就是列名,xtype就是資料型別,但是這個xtype是數字的,下面是數字和資料型別對應的關係;

xtype=34 'image'

xtype=35 'text'

xtype=36 'uniqueidentifier'

xtype=48 'tinyint'

xtype=52 '**allint'

xtype=56 'int'

xtype=58 '**alldatetime'

xtype=59 'real'

xtype=60 'money'

xtype=61 'datetime'

xtype=62 'float'

xtype=98 'sql_variant'

xtype=99 'ntext'

xtype=104 'bit'

xtype=106 'decimal'

xtype=108 'numeric'

xtype=122 '**allmoney'

xtype=127 'bigint'

xtype=165 'varbinary'

xtype=167 'varchar'

xtype=173 'binary'

xtype=175 'char'

xtype=189 'timestamp'

xtype=231 'nvarchar'

xtype=239 'nchar'

xtype=241 'xml'

xtype=231 'sysname'

SQL欄位常用型別

一般的常用字段有下面幾種 varchar char text int allint tinyint numeric money allmoney bitdatetime 不同的字段型別用來存放不同型別的資料。建立和使用表時,更你應該理解五種常用的字段型別 字元型,文字型,數值型,邏輯性和日期型。字元...

sql取字段中間幾位 為啥你這個sql怎麼慢呢

有些一句簡單的sql看起來平平無奇,但是卻執行很慢,一般存在這麼幾種可能性 針對sql執行慢,我們要做的首先就是定位出這些sql,然後再看這些sql是否正確建立並使用索引 慢查詢分析 mysql中自帶了慢查詢日誌的功能,使用show variables like slow query log 來查詢...

SQL2008 擷取字段函式

ltrim int轉字元 left abc 2 ab right abc 2 bc substring abc 1,2 ab 和delphi中的copy一樣 120 或者 20 yyyy mm dd hh mi ss 24h 121 或者 21 yyyy mm dd hh mi ss.mmm 24h...