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

Click here to load this message in the networking platform