随笔分类 -  SQL Server

摘要:create table Person( Age int )--Viewselect agefrom Person出来结果列名[age]变成[Age]select age as agefrom Person出来的列名就是[age] 阅读全文
posted @ 2013-06-07 10:00 YF.G 阅读(407) 评论(0) 推荐(0)
摘要:MSDN上说明很详细:http://msdn.microsoft.com/en-us/library/windows/desktop/ms709353(v=vs.85).aspx举个例子来说,test.csv文件内容如下Type,V1,V2,Qty19809,123,124,342ab23,343,435,2223456,908,987,16我遇到的情况是,SQL SERVER数据库,用OPENDATASET访问(out of scope),结果是Type这一列中只能够读取到第一、三行,而第二行的数据被忽略掉。猜测是因为默认Type列的类型是数值型(可能根据第一行判断),所以忽略了Type值不 阅读全文
posted @ 2012-11-13 17:38 YF.G 阅读(882) 评论(0) 推荐(0)
摘要:SQL SERVER 查询数据库对象(视图和存储过程等)的创建脚本select text from syscomments where id =(select id from sysobjects where name='vw_orderitem'--vw_orderitem为视图的名称)可以查询表名,视图名,存储过程名等select * from sysobjects --where xtype='U' --表名--where xtype='V' --视图名--where xtype='PK' --主键--where xtype 阅读全文
posted @ 2012-03-01 08:45 YF.G 阅读(280) 评论(0) 推荐(0)
摘要:The list of styles that can be applied are:SQL Style IDSQL StyleExample0 or 100mon dd yyyy hh:miAM (or PM)Jan 15 2008 5:44PM101mm/dd/yy01/15/2008102yy.mm.dd2008.01.15103dd/mm/yy15/01/2008104dd.mm.yy15.01.2008105dd-mm-yy15-01-2008106dd mon yy15 Jan 2008107Mon dd, yyJan 15, 2008108hh:mm:ss17:42:339 or 阅读全文
posted @ 2012-01-11 13:40 YF.G 阅读(169) 评论(0) 推荐(0)