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)
 update with exec

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2007-07-12 : 12:15:16
Hi,
What is the correct syntax to get this query to work please.
I think there is a problem with set xmlContents =

I think the rest is self explanatory.

Thanks

update
tblTrades
set
xmlContents = Exec ('SELECT Cast(BulkColumn as Nvarchar(max)) FROM OPENROWSET(BULK ''' + @FilePath + ''', SINGLE_CLOB) as D')
where
TradeFileName = @TradefileName

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-07-12 : 12:29:18
simply put you can't use exec in update statements.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-07-12 : 13:02:31
create table #a(s varchar(8000))
insert #a Exec ('SELECT Cast(BulkColumn as Nvarchar(max)) FROM OPENROWSET(BULK ''' + @FilePath + ''', SINGLE_CLOB) as D')
update
tblTrades
set
xmlContents = (select s from #a)


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -