ALTER TABLE ALTER COLUMN to set Default 
Author Message
 ALTER TABLE ALTER COLUMN to set Default
What is the syntax for the ALTER TABLE ALTER COLUMN to set
the default for an existing column.  I want to set a
uniqueidentifier column to have the default of NewID().  
TIA.


Sat, 29 May 2004 06:04:16 GMT
 ALTER TABLE ALTER COLUMN to set Default

Hi,

ALTER TABLE [TableName] ADD
 CONSTRAINT [DefaultConstraintName] DEFAULT (newid()) FOR
[ColumnName]

Dinesh.


Quote:
> What is the syntax for the ALTER TABLE ALTER COLUMN to set
> the default for an existing column.  I want to set a
> uniqueidentifier column to have the default of NewID().
> TIA.



Sat, 29 May 2004 06:24:03 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Alter Table - Alter Column - Set Default ?'s

2. syntax for ALTER TABLE ALTER COLUMN DEFAULT

3. multiple ALTER COLUMNs in one ALTER TABLE statement?

4. Help with Alter Table Alter Column

5. Alter Table Alter Column Syntax

6. Alter table alter column

7. alter table alter column

8. Alter table alter column syntax

9. Alter table Alter column problem.

10. ALTER TABLE ... ALTER COLUMN IDENTITY

11. ALTER TABLE ALTER COLUMN

12. Alter table alter column text


 
Powered by phpBB® Forum Software