Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stored proc as default?
Message
De
27/10/1999 10:31:45
 
 
À
27/10/1999 09:17:54
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00281455
Message ID:
00282247
Vues:
27
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
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform