Viewing 5 posts - 16 through 21 (of 21 total)
Create table tbl(title nvarchar(40))
Create procedure df_bppr @de nvarchar(30)
As
Begin
Declare @sstr nvarchar(500)
Set @sstr = N'Alter Table tbl Add Constraint df_title Default '+ @de + N' For title'
Exec sp_executesql (@sstr)
End
Msg 102, Level...
April 15, 2008 at 5:08 am
Create table tbl(title nvarchar(40))
Create procedure df_bppr @de nvarchar(30)
As
Begin
Declare @sstr nvarchar(500)
Set @sstr = N'Alter Table tbl Add Constraint df_title Default '+ @de + ' For title'
Exec sp_executesql @sstr, @de
End
Execute df_bppr...
April 15, 2008 at 2:38 am
Thanks for reply. I tried the following but got error. Please rectify.
Create procedure df_bppr @de nvarchar(30)
As
Begin
Declare @sstr nvarchar(500)
Set @sstr = N'Alter Table tblbppr Add Constraint df_title Default '+ @de +...
April 15, 2008 at 12:56 am
ALTER table newtab add constraint chk CHECK (col1 IN('0','1','2','3') and col2 IN('0','1','2','3') .... )
The above code works. But in future if i want to change this, again i have to...
April 8, 2008 at 3:02 am
Sorry I will give explain further.
I have more than 8 eight columns all should have only value IN(0,1,2,3,4,5). I dont want include seperate CHECK CONSTRAINT for each columns as the...
April 8, 2008 at 12:42 am
Viewing 5 posts - 16 through 21 (of 21 total)