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)
 Write Stored procedure to pull qeury from table

Author  Topic 

kdeutsch
Yak Posting Veteran

83 Posts

Posted - 2009-08-19 : 12:26:06
I am tring to write a stored procedure to pull a query from a table. I have a table full or queries that are assigned to personnel to run via a stored procedure. Problem is never done it and I am having trouble finding anything on web. Basically how can I create a stored procedure to call a sql query from a table?

example query in table.
intFilterID = 6
strTaskName = 2x Non Select
strProponent = Personnel
strApprovalLevel = Manager
strTaskCat = A1
strSQLQuery =
Select Case when PROM_CON_CODE in ('F3') then 'RED' else 'GREEN' END from SIDPERS..SIDPERS.PERS_SVCMBR_TBL where MPC = 'O'

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-19 : 13:11:17
Can you create (one or more) parameterized stored procedures and just store the parameters in the table?

EDIT:

Post a real example of the data that would be stored and the resulting "query".

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -