Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored proc as default?
Message
From
27/10/1999 15:50:35
 
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00281455
Message ID:
00282604
Views:
32
>Joe,
>
>I think you solution is very close. What about modifying the DEFAULT constraint instead of dealing with DEFAULT objects.
>
>CREATE PROCEDURE ChangeDefaultTaxRate
> @newrate decimal(6,3)
>AS
>
>DECLARE @cmd varchar(1000)
>SET @cmd = 'ALTER TABLE customer ADD CONSTRAINT df_taxrate DEFAULT ( ' + CONVERT(varchar(20), @newrate) + ') FOR cu_taxrate'
>
>ALTER TABLE customer DROP CONSTRAINT df_taxtrate
>EXECUTE (@cmd)
>
>
>-Mike

That's cool. I just got into the habit of using "canned" defaults in all my databases since they're reusable.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform