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 |
kneel
Starting Member
36 Posts |
Posted - 2007-08-17 : 05:29:10
|
Hello All,I am writing cursor in stored procedure,In which i want some records which are passed thorough parameter @GroupIDList which is varchar. But in table Contacts datatype of group id is INT. so it throws error as Syntax error converting the varchar value '73,443,343' to a column of data type int.Does anybody know solution for it ? ALTER PROCEDURE [dbo].[prDeleteGroups]( @UserID VARCHAR(20), @GroupIDList VARCHAR(1000))WITH RECOMPILEAS SET NOCOUNT ON --SET @vchSQL = '' SET @chMsgIDList = '' SET @chMsgID = '' SET @chUserID = '' DECLARE @MSGID CURSOR SET @MSGID = CURSOR LOCAL FAST_FORWARD READ_ONLY FOR SELECT DISTINCT MsgID FROM Contacts WHERE GROUPID IN (@GroupIDList) OPEN @MSGID FETCH FROM @MSGID INTO @chMsgID |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
kneel
Starting Member
36 Posts |
Posted - 2007-08-18 : 03:50:54
|
Hi,thanx for this. my problem is solved--kneel |
 |
|
|
|
|