`

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

 

 

ISSUE 2: Incorrect syntax near the keyword 'DEFAULT'

 

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.

分享到:
评论

相关推荐

    SqlServer GroupConcat

    `SqlServer GroupConcat`的CLR实现是为了解决SQL Server中缺乏类似MySQL `GROUP_CONCAT`功能的问题。CLR(Common Language Runtime)是.NET框架的一部分,允许开发者使用各种编程语言(如C#、VB.NET等)编写存储过程...

    SQL Server for C# Developers Succinctly

    Sander Rossel will take readers through common pitfalls, why databases run slowly, how to troubleshoot performance issues, and how to test and deploy SQL Server databases. The first half of SQL ...

    Microsoft SQL Server 2008 - T-SQL Querying March 2009

    Inside Microsoft SQL Server 2008: T-SQL Querying puts together all the ingredients you need to understand this declarative and set-oriented way of thinking and become a profi cient SQL programmer, ...

    Pro.SQL.Server.Always.On.Availability.Groups.1484220706.epub

    Techniques to troubleshoot common issues that you may face during and after deploying availability groups in a mission-critical production environment. What You Will Learn Grasp important concepts ...

    Healthy SQL.pdf

    All these issues that occur on the back-end SQL Server instance frustrate users, and organizations don’t usually have the database administrator (DBA) skill set in-house to fix these performance ...

    SQL.Server.DMVs.实战

    ### SQL Server DMVs 实战:深入理解与应用 #### 一、引言 自2005年以来,动态管理视图(Dynamic Management Views,简称DMVs)已成为SQL Server性能监控的核心工具之一。对于希望成为数据库管理员(DBA)或优秀数据库...

    SQL Server MVP Deep Dives in Action

    Some great approaches to common problems, some great forays into areas I have, unfortunately, not forced myself to get into (like Power Shell for my administrative tasks). I will be taking some of the...

    微软内部资料-SQL性能优化3

     Analyze the output of blocking scripts and Microsoft® SQL Server™ Profiler to troubleshoot locking and blocking issues.  Formulate hypothesis to resolve locking and blocking issues. ...

    LOGICAL FOR ETL DOC

    Inside Microsoft SQL Server 2008: T-SQL Querying puts together all the ingredients you need to understand this declarative and set-oriented way of thinking and become a profi cient SQL programmer, ...

    Applied XML Programming for Microsoft .NET

    transformations, and XPath, plus extensive discussion of data access issues such as synchronization and serialization, the DiffGram format, and the XML extensions in Microsoft SQL Server™ 2000....

    Microsoft SharePoint 2010 Administrator's Companion

    you'll discover how to plan, design, deploy, and manage strategic solutions using SharePoint 2010, Microsoft SQL Server®, Windows PowerShell™, and other key technologies. Topics include ...

    ODTwithODAC122011.txt

    Important: If installing ODAC into an existing Oracle 12c home, review the "Common Install and Setup Issues" section of the ODAC installation instructions. This download includes: Oracle Developer ...

    MCTS Self-Paced Training Kit (Exam 70-448)

    - **Identifying and Resolving Deployment Issues (Chapter 1-3, Lessons 1-2):** Troubleshooting common deployment issues and resolving them effectively. ##### **Implementing an SSAS Solution** - **...

    CLR via C# 3rd Edition

    Forms, Microsoft(R) SQL Server(R), Web services, and console applications. You’ll get hands-on instruction and extensive C# code samples to help you tackle the tough topics and develop high-...

Global site tag (gtag.js) - Google Analytics