Forum Replies Created

Viewing 5 posts - 16 through 21 (of 21 total)

  • RE: DDL in Stored Procedure with variables

    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...

  • RE: DDL in Stored Procedure with variables

    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...

  • RE: DDL in Stored Procedure with variables

    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 +...

  • RE: Rule Vs. CHECK

    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...

  • RE: Rule Vs. CHECK

    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...

Viewing 5 posts - 16 through 21 (of 21 total)