|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have the follwoing SPROC (it's not working yet):
CREATE PROCEDURE [dbo].[usp_UpdateBudgetUpdate] @Budget decimal (18,3), @WPID nvarchar(100), @FY nvarchar(4) AS UPDATE Budget SET WP_Budget.+'@FY'+ = @Budget WHERE Identifier = @WPID GO The column WP_Budget.* can either be: WP_Budget.FY04 WP_Budget.FY05 WP_Budget.FY06 WP_Budget.FY07 WP_Budget.FY08 WP_Budget.FY09 WP_Budget.FY10 WP_Budget.FY11 WP_Budget.FY12 WP_Budget.FY13........and up to 20 I'd like to not have to create 20 SPROCs. Any suggestions are welcome! Thanks! |
|
#2
|
|||
|
|||
|
Hi !
Why don't you write a SQL Batch that creates all the stored procedures you want at one go. Then execute it with OSQL or Query Analyzer. Change the name of all the procedures in the same batch. I hope you need not write the same for 20 times. - Som Dutt |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > SPROC for dynamic column??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|