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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Error converting data type varchar to bigint

Author  Topic 

Punisher
Starting Member

2 Posts

Posted - 2004-03-22 : 14:33:42
Ok, Im staring to feel real stupid. This is a very simple query and its giving me back 'Error converting data type varchar to bigint.'

The Stored Procedure is as follows.
---------------------------------------------------
CREATE PROCEDURE [dbo].[NG_Select_Bread_Crumb_Trail_01_Main]
AS
DECLARE @FatherIDs VARCHAR(1024)
DECLARE @ID VARCHAR(1024)
--calls another stored procedure and gets the results--
EXEC NG_Select_Bread_Crumb_Trail_01_Sub @ID, @FatherIDs OUTPUT
--for debugging
PRINT 'SELECT ID, Title FROM NG_Catagories WHERE (ID IN(' + @FatherIDs + '))'
SELECT ID, Title FROM NG_Catagories WHERE (ID IN( @FatherIDs ))
GO
----------------------------------------------------
When i execute the SP in query analyzer I get the following back
/*-----------------------------
DECLARE @RC int
EXEC @RC = [ST_DEV_BP].[dbo].[NG_Select_Bread_Crumb_Trail_01_Main]
DECLARE @PrnLine nvarchar(4000)
-----------------------------*/
SELECT ID, Title FROM NG_Catagories WHERE (ID IN(11,12))
Server: Msg 8114, Level 16, State 5, Procedure NG_Select_Bread_Crumb_Trail_01_Main, Line 7
Error converting data type varchar to bigint.
-----------------------------------------------------

Can anyone give me a clue why im getting this error.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-22 : 14:36:45
You aren't going to be able to do that:

http://www.sqlteam.com/item.asp?ItemID=11499

Tara
Go to Top of Page

Punisher
Starting Member

2 Posts

Posted - 2004-03-22 : 14:49:26
Tara

Thanks for the quick reply. I dont feel so stupid now. Im supprised I was'nt able to find that article or a refrence to it, I looked all over google and found nothing close to what I was trying to do.

By the way that's a pretty cool function in the article, I'll have to make use of that.

Greg
Go to Top of Page
   

- Advertisement -