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 |
homebrew
Posting Yak Master
114 Posts |
Posted - 2003-11-17 : 16:34:43
|
I'm running a DTS package that has been fine for months, but I just installed SQL 2000 SP3, and now I get this error message during part of one step (the other commands in the step are ok) :-------------------------------------------Error Source: Microsoft OLE DB Provider for SQL ServerError Description: Unspecified Error---------------------------------------------The code I'm trying to execute is:SET NOCOUNT ONdeclare @prd_typ char (2)DECLARE products CURSOR FORselect * from produpd where prd_type = ' 'OPEN productsFETCH NEXTfrom productsWHILE @@FETCH_STATUS = 0BEGINexec ('update produpdSET produpd.PRD_TYPE = (SELECT top 1 producttypeval.prod_type FROM producttypevalWHERE produpd.prod_type_adv = producttypeval.prod_type_adv )where prd_type = '' '' and @@error = 0 ')FETCH NEXTfrom productsendCLOSE productsDEALLOCATE products -----------------------If I execute that code in Query Analyzer, it works fine .... there's now something screwy about the connection in my DTS, even though I haven't modified it in months.Any ideas ? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-11-17 : 16:41:31
|
Why the use of dynamic sql? Your UPDATE statement does not require this. Also, use an explicit column list instead of SELECT *. Why the use of a cursor? Can't you run the UPDATE statement by itself. You aren't using the cursor in the statement as far as I can tell.Have you tried creating a new DTS package with just this task to see if it works there. It is possible that the step is corrupted in some way.Tara |
|
|
|
|
|