Ask a Question related to Coldfusion Database Access, Design and Development.
-
Msabry #1
lists in stored procedure
Hi,
I am trying to write a stored procedure that would do something like this
create proc test
@category int,
@itemList varchar(100)
as
begin
set @itemList='select itemID from table.items where category=@category'
EXEC sp_executesql @itemlist
select * from table.itemdesc
where itemId in (@itemlist)
end
go
so the idea, is to get all the rows in the table that meet a certain
constraint, pass the id's of those rows to another query that would get the
info for the specific item.
I also need to find out how to make the query loop over a list of inputs and
return the relevant data,
thanks
Msabry Guest
-
Stored Procedure
EXEC master..xp_cmdshell 'cscript c:\path\file.vbs' EXEC master..xp_cmdshell 'c:\path\file.exe' "Kannan" <gk_i@yahoo.com> wrote in message... -
SQL Stored Procedures and Lists of Strings
Hey all. I've been pulling my hair out all day today trying to get this to work. I can do what i want to do in a straight <cfquery>, but i'm... -
stored procedure help
Hi all! I am in need of writing a few stored procedures. The first one is to create a stored procedure to recover a database from backup and the... -
stored procedure value
How can I bind a stored procedure value to a page? I've executed a stored procedure and there should be two column values created...i.e. col1 and... -
Stored procedure?
Stored procedure ?? -- Message posted via http://www.dotnetmonster.com -
PaulH *ACE* #2
Re: lists in stored procedure
why bother w/a list & all that:
SELECT *
FROM table.itemdesc
WHERE itemId IN
(
SELECT itemID
FROM someTable.items
WHERE category=@category
)
or do a JOIN or use EXISTS
PaulH *ACE* Guest



Reply With Quote

