Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB Tools

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2013, 09:52 AM
Bita Bita is offline
Junior Member
 
Join Date: Aug 2010
Posts: 5
Default Error in Set parameters in sql server Stored procedure

Hi Everybody
I'm new in sql , I wrote a stored procedure with input parameter @TStr, I write this line in part of my command
select * from X where TID in (@TStr)

but error ocurred with error line:

"Conversion failed when converting the nvarchar value '414,419' to data type int."

TID is int, and @TStr nvarchar(max) for set of int, I set @TStr=414,419
if I set @TStr=414 it works OK , but I must define it for using in set.

can anyone help me please?
Reply With Quote
  #2  
Old 05-29-2013, 02:43 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default

You can only call this through an exec statement inside the stored procedure.
So build the sql as a string and execute it, you cannot directly convert the string with id's to a list of id's (error tells you already)
Reply With Quote
Reply

Tags
parameter, stored procedure

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 07:26 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.