Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Datatype conversion in Stored Procedures
Old 01-03-2006, 12:25 PM Datatype conversion in Stored Procedures
Super Talker

Posts: 148
Trades: 0
I am trying to achieve such a command in my stored procedure as shown below. However, the setback is that "itemid" is an integer data type and i wish to store "1,2" data in "@ITEMID" parameter. Tried putting "@ITEMID VARCHAR(100)", but it does not work. Anyone know how i can work around this?

The error message is:
Syntax error converting the varchar value '1,3' to a column of data type int.

Code:
Select * from m.mstritem
where m.itemid not in (1,2)
Code:
Stored Procedure:
CREATE PROCEDURE [SEARCHSALEITEM]
(

@ITEMID VARCHAR(100)
)

As
SELECT *
FROM MSTRITEM M
WHERE (M.ITEMID=I.ITEMID)
AND (M.ITEMID NOT IN (@ITEMID))

GO
shaoen01 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-04-2006, 08:03 AM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
Can you describe what it is you're trying to acheive?
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Reply     « Reply to Datatype conversion in Stored Procedures
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20995 seconds with 12 queries