ITKeyword,专注技术干货聚合推荐

注册 | 登录

SQL Server common issues

tomboxfan 分享于

2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1062

2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址https://www.aliyun.com/minisite/goods

推荐:SQL Server中的GO详解

下面的两组SQLServer语句使用go和不使用go好像没有区别。    (一)    create   table   aa(col1   int,col2   char(10))    go    create   table   bb(col1  

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 instructs Query Analyzer to interpret and run the preceding T-SQL statments.

 

 

ISSUE 2: Incorrect syntax near the keyword 'DEFAULT'

 

推荐:sql server

http://593321134.blog.163.com/blog/static/505978862009102055439504/ http://tech.sina.com.cn/s/2009-11-26/00481148854.shtml http://technet.microsoft.co

You can't simply alter a column like this :

ALTER TABLE GreenscopeUser ALTER COLUMN Enabled nChar(1) not null DEFAULT 'Y';

 

You should alter the column like this:

ALTER TABLE GreenscopeUser ALTER COLUMN Enabled nChar(1) not null;

ALTER TABLE GreenscopeUser ADD CONSTRAINT default_Enabled DEFAULT 'Y' FOR Enabled;

 

Also please don't forget the remove all constraints on this column before you change it.

推荐:SQL Server

一、 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO         这些是 SQL-92 设置语句,使 SQL Server 2000/2005 遵从 SQL-92 规则。       1)当 SET QUOTED

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.

相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。