April 20, 2010 at 12:42 am
hi,
I am having a table. which is taking by default NULL values...
Now i want to update the Column default to'XXXX'
Script:-
CREATE TABLE [dbo].[Testowners](
[owner_id] [int] NULL,
[owname] [varchar](15) NULL
)
Alter Script 1:-
ALTER TABLE Owners
ALTER Column [owner_id] INT NOT NULL
Alter Script 2:-
ALTER TABLE Owners
ALTER Column owname VARCHAR(35) Default 'XX'
The first Alter Statement is working fine.
Cant i use the Default in Alter statement ....
Thnaks in advance.......
April 20, 2010 at 12:54 am
I got solution......... :-D:-D
ALTER Table Owners
ADD CONSTRAINT con_owname DEFAULT 'XXX' FOR owname
But Y dont we use Default in the Alter statement. Event the below link shows it in Syntax...by SET Default...
April 20, 2010 at 5:43 am
That is the Books Online entry for SQL Server Compact 3.5 Service Pack 1.
You want the SQL Server 2008 entry:
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply