SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 update with exec
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

arkiboys
Flowing Fount of Yak Knowledge

1406 Posts

Posted - 07/12/2007 :  12:15:16  Show Profile  Reply with Quote
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

Slovenia
11750 Posts

Posted - 07/12/2007 :  12:29:18  Show Profile  Visit spirit1's Homepage  Reply with Quote
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

United Kingdom
12543 Posts

Posted - 07/12/2007 :  13:02:31  Show Profile  Visit nr's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000