![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Sql Server
文章平均质量分 54
iteye_5554
这个作者很懒,什么都没留下…
展开
-
Incorrect syntax near the keyword 'DEFAULT'
I met this issue on Oct 21st, 2009. The Sql Server conplains db.update: [sql] Failed to execute: ALTER TABLE Green ALTER COLUMN Enabled nChar(1) not null DEFAULT 'Y'BUILD FAILEDco...原创 2009-10-21 11:03:30 · 741 阅读 · 0 评论 -
不要通过CREATE TABLE语句来创建default constraint
The reason why you should not use CREATE TABLE to create the default constraint is, system will generate a random constraint name for you. And when you drop it, your sql will be only workable in eithe...原创 2009-10-21 13:15:21 · 426 阅读 · 0 评论 -
SQL Server common issues
ISSUE 1: Incorrect syntax near 'GO'. replace GO with ; 1) GO is a keyword for Query Analyzer, not belongs to T-SQL. So, if you don't use Query Analyzer, GO is not recoganized. 2) GO instr...原创 2009-10-21 16:04:47 · 149 阅读 · 0 评论 -
SQL Server 日期格式转换
SQL Server中文版的默认的日期字段datetime格式是yyyy-mm-dd Thh:mm:ss.mmm 例如: select getdate() 2004-09-12 11:06:08.177 整理了一下SQL Server里面可能经常会用到的日期格式转换方法: 举例如下: select CONVERT(varchar, getdate(), 120 ) 2004-09-12 11:06...原创 2009-11-10 19:34:27 · 91 阅读 · 0 评论 -
数据库分页
sqlserver2000的分页就是利用top、order by、asc、desc这几个关健字来控制分页查询。 mysql是通过limit等关健字。 而oracle则是利用rownum这个虚列来进行分页。 http://www.vifir.com/bbs/html/20080527/426030.html...原创 2009-12-07 11:56:55 · 84 阅读 · 0 评论 -
SQL Summary
show primary key infosp_pkeys EMPLOYEEset a explicit pk name during creating tableCREATE TABLE EMPLOYEE( ID int Not Null CONSTRAINT pk_EMPLOYEE_ID PRIMARY KEY, FirstName nvarchar(20), LastName n...原创 2009-12-09 11:41:29 · 347 阅读 · 0 评论