Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
nhaas
Yak Posting Veteran
90 Posts |
Posted - 2012-12-22 : 23:16:46
|
is this type of Procedure possible, I have tried this and nothing happens. I have verified that the data is going to the Procedure.CREATE PROCEDURE BillingUpdateVoip(@P varCHAR(50),@P1 varCHAR(15),@P2 varchar(15))ASUpdate VoipNumbers SET @P=@P1 where Voipnumber=@P2GO |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-12-23 : 01:45:32
|
this procedure doesnt make any sense. whats the use of UPDATE if you're just trying to set a value for external variable? wont below be enough?SET @P = @P1if the attempt is to set the value of field which is passed dynamically then you need dynamic sqlCREATE PROCEDURE BillingUpdateVoip(@P varCHAR(50),@P1 varCHAR(15),@P2 varchar(15))ASDECLARE @SQLString varchar(8000)SET @SQLString = 'Update VoipNumbers SET ' + @P + ' = ''' + @P1 + ''' where Voipnumber= ''' + @P2 + ''''EXEC(@SQLString)GO ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|