sql server - SELECT ... FOR XML into a file -


i have query returning large xml, size can reach 1gb in extreme cases, takes hundreds of megabytes.

the obvious approach when client program receives data @ once , keeps in memory doesn't work in case.

is there way make sql server output result file? or maybe deliver resulting data piece piece? in latter case trivial direct ouput file without loading memory.

according statement of problem resulting xml transformed xslt produce smaller result. ideally server should instructed output xml data pipe connected xslt engine being run separate process. don't see way this.

are there ideas?

thank you.

client program written in c# 3.

sql server version 2005, if solution exists in 2008 only, restriction should not considered essential

assuming using .net language , ado.net, here

http://www.csharp-station.com/tutorials/adodotnet/lesson02.aspx

you find example how feed result set of select sql console stream using sqldatareader. replace console file stream , done.

unfortunately, works if xml stored in several text rows, line-by-line. if xml stored in blob field, need kind of chunking. read article how this:

http://support.microsoft.com/kb/317034/en-us


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -