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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 looking for generic update stored procedure

Author  Topic 

EltonSky
Starting Member

2 Posts

Posted - 2008-06-24 : 23:35:56
Hello guys,

I m gonna do a generic ST. for update.
I think I should use dynammic query. Cause I dn't know how many params will be passed, I think I need a string of param names, a string of param types and a string of param values. Then I build the dynamic query with these strings of parmas.

The thing is I suppose the solution above is too trivial and user need to pass many params.

Is there any other idae on this?

Please feel free to advise me, I appreciate.
Cheers,
elton

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-25 : 02:21:19
I think you need to use sp_executesql seeing your description. If you can elaborate on this a bit more, we will able to analyse if this can be done in any easier way. Providing some sample data to illustrate your scenario might also help a great deal.
Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2008-06-25 : 07:50:29
(Moved to the T-SQL Forum)

=================================================
Creating tomorrow's legacy systems today. One crisis at a time.
Go to Top of Page
   

- Advertisement -