随笔分类 -  SQL

摘要:SyntaxSyntax for CAST:CAST (expression AS data_type [ (length ) ] )Syntax for CONVERT:CONVERT (data_type [ (length ) ] ,expression [Argumentsexpressio... 阅读全文
posted @ 2015-12-09 15:49 facial 阅读(272) 评论(0) 推荐(0)
摘要:1down voteMy solution (Guides -> List of Guid):List tsts = new List();for(int i = 0; i Guides.Skip(i * 2000).Take(2000).Contains(x.tstGuid)));}this.D... 阅读全文
posted @ 2015-09-07 12:54 facial 阅读(238) 评论(0) 推荐(0)
摘要:"String or binary data would be truncated. The statement has been terminated" most probably means that the size ofvalue you want to insert is larger t... 阅读全文
posted @ 2015-07-01 17:03 facial 阅读(456) 评论(0) 推荐(0)
摘要:Recently while working with data migration,got an error while running a following query where Server2 has beed added as linked server.SELECT * FROM Se... 阅读全文
posted @ 2015-06-16 16:10 facial 阅读(980) 评论(0) 推荐(1)
摘要:以前创建数据库时就是有主键的创建了主键,但是表之间的关系没有联系,要建数据库关系图只有主键没有外键时不行的。 建外键的前提是此外键必须是另外一个表的主键。建外键的步骤: 第一步打开要建外键表的设计器,右击选择“关系”。然后弹出“外键关系”窗体,我们选择“添加”,然后点击“表和列规范”后面的小按钮,... 阅读全文
posted @ 2015-04-16 16:39 facial 阅读(17421) 评论(0) 推荐(1)
摘要:1 sql 查询某字段id为空 select * from表名 where id is null ;2sql 查询某字段id不为空 select * from 表名 where id is not null;或 select * from 表名where id null; // select * f... 阅读全文
posted @ 2015-03-27 10:43 facial