Re: Cursor Error...

From: marcmc (marcmc_at_discussions.microsoft.com)
Date: 04/01/05


Date: Fri, 1 Apr 2005 06:23:03 -0800

thanks Dan, I replaced
/*
UPDATE @tbl_name1
SET marcA = substring(marcA,1,2)
WHERE marc = 1
*/

to dynamic as follows but it only updates the first row of the first
table...Any ideas

Set @Command = ' UPDATE ' + @tbl_name + '
SET marcA = substring(marcA,1,2)
WHERE marc = 1 '
                        
Execute sp_executesql @Command



Relevant Pages

  • Re: Cursor Error...
    ... It appears you need a FETCH within the WHILE loop. ... Execute sp_executesql @Command ... > to dynamic as follows but it only updates the first row of the first ...
    (microsoft.public.sqlserver.security)
  • Re: SQL to XML File
    ... xml-string was in the first row, first column, though... ... so just dump ... Marc ...
    (microsoft.public.sqlserver.xml)