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.
| Author |
Topic |
|
Hommer
Aged Yak Warrior
808 Posts |
Posted - 2004-11-15 : 10:59:04
|
| I have this sp:CREATE proc stsQuoteToOrdersList @QuoteNumber varchar(20), @OrderList varchar(100) outputasbegin select @OrderList= Coalesce(@OrderList+',',' ') + CO_Numberfrom stsJobTracking where QuoteNumber = @QuoteNumberreturn @OrderListendGOWhen I tried to call it in QA usingDECLARE @Orderlist VARCHAR(100)exec stsQuoteToOrdersList Q244255, @OrderlistPRINT @OrderlistI got:Syntax error converting the varchar value ' 613977,613978,613979' to a column of data type int.There is nowhere in the process that an int is involved. What did I miss? Thanks! |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-11-15 : 11:04:31
|
you have to convert the column as it is an int columnselect @OrderList= Coalesce(@OrderList+',',' ') + convert(varchar,CO_Number)Corey |
 |
|
|
Hommer
Aged Yak Warrior
808 Posts |
Posted - 2004-11-15 : 11:24:13
|
| Thank you Corey!I got the return value I want.Also, I needed to replace return @OrderList with Select @OrderList to make it work.However, when I tried to include the sp in a select list, error says it is not a function. I guess I need a user defined functions instead of the sp. |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-11-15 : 15:16:51
|
How were you trying to include it in a sp?as columndata, or as a subquery?Corey |
 |
|
|
|
|
|
|
|