General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
You can put something like this in a stored procedure and provide some functionality to call it in the front end:
----------------------------
CREATE PROCEDURE ChangeTaxRate @newrate decimal AS
IF OBJECT_ID('dbo.CurrentTaxRate') IS NOT NULL
EXEC sp_unbindefault 'CurrentTaxRate'
DROP Default dbo.CurrentTaxRate
CREATE DEFAULT dbo.CurrentTaxRate AS @newrate
EXEC sp_bindefault 'dbo.CurrentTaxRate', 'Customer.TaxRate'
----------------------------
I just kind of made it up on the fly so if you find this approach useful you will have to fiddle with it a little.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only