Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

weird SP problem

Status
Not open for further replies.

Aeros

Programmer
Oct 7, 2002
166
US
When I run this query is query analyzer I get the results I expect but when I run the stored procedure with the same query I get 0 results. Any ideas?

<cfparam name="sqlCatID" default="">
<CFSTOREDPROC procedure="dbo.GetListingsByCatID" datasource="tswdb">
<CFPROCPARAM type="IN" dbvarname="@sqlCatID" value="air" cfsqltype="CF_SQL_CHAR">
<CFPROCRESULT name="selectListings">
</CFSTOREDPROC>



CREATE PROCEDURE dbo.GetListingsByCatID
@sqlCatID char(3)
AS
select CO_CATG_TBL.co_id,CO_CATG_TBL.catg_code, company_tbl.sort_name, company_tbl.co_name
from CO_CATG_TBL
join company_tbl on CO_CATG_TBL.co_id = company_tbl.co_id
where CO_CATG_TBL.catg_code = '@sqlCatID'
order by company_tbl.sort_name
GO
 
Are you sure that works correctly in Query Analyser? Should d '@sqlCatID' be contained in single quotes? Also try setting up a trace in Query Analyzer and then call the stored procedure this will allow you to see the actual query being run
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top