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.

你可能感兴趣的:(sql,SQL Server,Go)