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 |
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2007-04-05 : 07:59:49
|
| I'm writing a ASP.NET page that uses a stored procedure with a required input parameter. The input string could be one integer or a sting of them separated by commas. CompID is an int field in my database. When I have a list of compIDs, I'm getting an error because the parameter isn't formatted correctly as an integer. I'm getting confused on how to pass a string of numbers to a procedure which expects an Int. Thanks'input parameter for the sproccmd.Parameters.Add("@CompID", SqlDbType.Int).Value = 12931,12937CREATE PROCEDURE sp_BenchmarkCompanyTotal@CompID IntASSELECT CompID, CompanyNameFROM TCompaniesWHERE CompID IN (@CompID)GO |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-04-05 : 08:03:12
|
| Check these links:[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=25830[/url][url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=6134[/url][url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648[/url]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|