Re: Alter Column
From: Mark Allison (marka_at_no.tinned.meat.mvps.org)
Date: 10/19/04
- Next message: Uri Dimant: "Re: Alter Column"
- Previous message: Tibor Karaszi: "Re: Problem with my SQL 2000 Maintenance plans."
- In reply to: Bob Trask: "Alter Column"
- Next in thread: Uri Dimant: "Re: Alter Column"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 19 Oct 2004 11:08:14 +0100
Bob,
You need to add a constraint to the column:
ALTER TABLE [tablename]
ADD CONSTRAINT <constraintname>
DEFAULT getdate() FOR [columnB]
-- Mark Allison, SQL Server MVP http://www.markallison.co.uk Looking for a SQL Server replication book? http://www.nwsu.com/0974973602m.html Bob Trask wrote: > Hi > > How come this doesnt work? > > > ALTER TABLE [tablename] ALTER COLUMN [columnB] SET DEFAULT getdate() > > Server: Msg 156, Level 15, State 1, Line 2 > Incorrect syntax near the keyword 'SET'. > >
- Next message: Uri Dimant: "Re: Alter Column"
- Previous message: Tibor Karaszi: "Re: Problem with my SQL 2000 Maintenance plans."
- In reply to: Bob Trask: "Alter Column"
- Next in thread: Uri Dimant: "Re: Alter Column"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|