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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting multiple IDs in a parameter within a select statement

Status
Not open for further replies.

TeaAddictedGeek

Programmer
Apr 23, 1999
271
US
My skills at T-SQL are a tad rusty, so please help me out here.

Here's the procedure I am trying to create:

[...]
@param varchar(20)
[...]
select * from

where table_type_id in (@param)

The problem is that when I put in the list of IDs, it tells me that it can't convert it to an int.

I am probably using the wrong datatype or something. I created procedures like this all of the time years ago back in SQL Server 7.0, but it's been a while. What am I doing wrong?


Thanks a bunch in advance!

"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum
 
Digging through the numerous pages of this forum yielded the following:


And it works! :D Thanks.

"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum
 
Hey, good job!

I was about to post the very same FAQ's to you!

I am glad to see someone reading them :-D

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top