Advertisement

04.02.2008 at 10:34AM PDT, ID: 23290175
[x]
Attachment Details

SQL Server 2005 - Add a NOT NULL constraint to a column

Asked by Endelm in SQL Server 2005, MS SQL Server, SQL Query Syntax

Hi,

I have a test table:

CREATE TABLE dbo.MyTable
(id                  INT                  NULL,
 v                  CHAR(1000) DEFAULT 'aaa',
)      

How do I add a NOT NULL constraint to the "id" column?

Thank you.Start Free Trial
[+][-]04.02.2008 at 10:41AM PDT, ID: 21265431

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2008 at 10:41AM PDT, ID: 21265433

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, MS SQL Server, SQL Query Syntax
Sign Up Now!
Solution Provided By: laneduncan
Participating Experts: 4
Solution Grade: A
 
 
[+][-]04.02.2008 at 10:42AM PDT, ID: 21265442

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2008 at 10:45AM PDT, ID: 21265481

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628