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)
 Problem with TEXT data type in Procedure

Author  Topic 

ikhuram
Starting Member

28 Posts

Posted - 2004-05-28 : 03:08:14
CREATE PROC usp_test_report @lot_list text, @wafer_list varchar(8000),
@test_nbr varchar(8000)
AS
DECLARE @sql varchar(8000)
SET QUOTED_IDENTIFIER OFF
SET ANSI_WARNINGS OFF

SET @sql = " SELECT test_summary.test_name, " +
" test_summary.execution_count, test_summary.failure_count, " +
" test_summary.alarm_count from test_summary join lot" +
" on test_summary.lot_sequence = lot.lot_sequence " +
" join wafer on test_summary.wafer_sequence = wafer.wafer_sequence" +
" WHERE lot.lot_sequence IN " + @lot_list +
" and wafer.wafer_sequence IN " + @wafer_list +
" ORDER BY test_summary.failure_count DESC"+
" test_summary.alarm_count"+ " DESC"

print @sql
EXEC(@sql)

I GOT ERROR:
Invalid operator for data type. Operator equals add, type equals text.

Please tell me how to fix this problem as my parameter can have more than 8000 characters.

Pethron
Starting Member

10 Posts

Posted - 2004-05-28 : 05:07:53
Isn't there an error because the " instead of a '?
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-05-28 : 09:27:57
At a glance..........you are also missing a comma after the 1st DESC

Also @lot_list shouldn't be TEXT....VARCHAR/CHAR is required......you can't mix data-types when building this type of statement....or else you need to do a 'convert'
Go to Top of Page
   

- Advertisement -