sql server 2000
if i pass a stored proc a string of 1,2,3,4,5 for @var_view and p.preorder_postatus_id has an datatype of integer...how could i convert this variable to and integer so the query can process it
*btw...i am passing the string to the stored proc from coldfusion
--------------------------------
CREATE PROCEDURE [sp_qry_get_preorders_1]
@agentid int,
@var_view varchar(50)
AS
select p.preorder_postatus_id, p.preorder_agent_id,p.preorder_id, c.customer_name, preorder_descr, (convert(smalldatetime,preorder_dt)) as preorder_dt, tcs.postatus_name
from tbl_preorder p left join
tbl_customer c on p.preorder_customer_id = c.customer_id left join
tbl_postatus tcs on tcs.postatus_id = p.preorder_postatus_id
where 0=0
and p.preorder_agent_id = @agentid
and p.preorder_postatus_id in (@var_view)
GO
--------------------------
any help will be greatly appreciated
thanks in advance
keith
if i pass a stored proc a string of 1,2,3,4,5 for @var_view and p.preorder_postatus_id has an datatype of integer...how could i convert this variable to and integer so the query can process it
*btw...i am passing the string to the stored proc from coldfusion
--------------------------------
CREATE PROCEDURE [sp_qry_get_preorders_1]
@agentid int,
@var_view varchar(50)
AS
select p.preorder_postatus_id, p.preorder_agent_id,p.preorder_id, c.customer_name, preorder_descr, (convert(smalldatetime,preorder_dt)) as preorder_dt, tcs.postatus_name
from tbl_preorder p left join
tbl_customer c on p.preorder_customer_id = c.customer_id left join
tbl_postatus tcs on tcs.postatus_id = p.preorder_postatus_id
where 0=0
and p.preorder_agent_id = @agentid
and p.preorder_postatus_id in (@var_view)
GO
--------------------------
any help will be greatly appreciated
thanks in advance
keith