<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>File Access and table-valued functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx</link><description>In this article, we will discuss a sample CLR function that illustrates accessing an external resource such as a file from inside a SQL Server stored procedure or function, . The sample highlights a number of different features and concepts, such as file-access,</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: File Access and table-valued functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#416436</link><pubDate>Wed, 11 May 2005 16:18:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:416436</guid><dc:creator>William Stacey</dc:creator><description>Thanks for the sample.  Would it be possible to post the client side code that calls this method and chunks file to the client file?  Also, maybe you could post the reverse too.  Uploading file to SQL using this method.  Thanks much!&lt;br&gt;--&lt;br&gt;William Stacey [MVP]</description></item><item><title>re: File Access and table-valued functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#416917</link><pubDate>Thu, 12 May 2005 19:56:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:416917</guid><dc:creator>sqlclr</dc:creator><description>Hi William,&lt;br&gt;&lt;br&gt;Can you give us a detailed description of your scenario? We would be glad to help you with a sample if we understand your needs better.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Sashi</description></item><item><title>re: File Access and table-valued functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#416991</link><pubDate>Fri, 13 May 2005 00:33:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:416991</guid><dc:creator>sqlclr</dc:creator><description>William,&lt;br&gt;Chunking the returned contents of this TVF (or for that matter any LOB value from the server) should be possible by writing an ADO.NET program that sets the CommandBehavior property of the SqlCommand to &amp;quot;SequentialAccess&amp;quot;. If you execute such a command, the resultant SqlDataReader will load LOB data as a stream. You can then use the GetBytes or GetChars method to specify a byte location to start the read operation, and a limited buffer size for the data being returned. If you think you still need a sample, let us know. &lt;br&gt;&lt;br&gt;As for the other direction, it is unfortunately not possible to &amp;quot;stream&amp;quot; a LOB value as an input parameter into SQL Server from the client as an argument of a stored procedure. (The client will buffer the entire value before sending it to the server).&lt;br&gt;&lt;br&gt;Balaji Rathakrishnan&lt;br&gt;Microsoft SQL Server</description></item><item><title>re: File Access and table-valued functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#417649</link><pubDate>Mon, 16 May 2005 01:04:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:417649</guid><dc:creator>William Stacey</dc:creator><description>Yes please, would still like a client sample.  There is something similar in a MSDN article (I think), but would like to see another implementation in the context of your server sample.  The sample case could be this:  You have a message row in sql db.  Message has subject, body, and can have 0 or more attachments. Get message row and all attachments.  Attachment reading should be stream based so not to load large files into mem on client.  GetAttachments(string[] attachmentIDs) could be a seperate call instead of grabbing attachments with the message.  Thanks for the feedback so far.  2005 looks great!</description></item><item><title>re: File Access and table-valued functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#417653</link><pubDate>Mon, 16 May 2005 01:15:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:417653</guid><dc:creator>William Stacey</dc:creator><description>Also..&lt;br&gt;It seems to me like explict support for .Net Streams could be supported and would make this kind of thing natural for the client side consumer.  The SQLClient could create and hook-up the stream (i.e. NetworkStream) based on the reply results.  Would seem possible to do both read and write streams.  This may need to happen outside the normal SP context - not sure, but think it can be done (all most things.)  Naturally, I could probably do this kind of thing with DIME and WSE 2.0 (or 3.0 and MTOM) if WSE was supported from SQLCLR (is it or will it?)  Thanks again!</description></item><item><title>re: File Access and table-valued functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#544819</link><pubDate>Tue, 07 Mar 2006 00:55:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:544819</guid><dc:creator>Timur</dc:creator><description>Is it possible to create similar function with OLAP SQL Server 2005 access.</description></item><item><title>re: File Access and table-valued functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#710887</link><pubDate>Mon, 21 Aug 2006 19:25:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:710887</guid><dc:creator>Vikrant</dc:creator><description>The same way as you loaded a document. is there a way read data from a table and write to a document in filesystem?</description></item><item><title>Using table-valued functions (TVF) in SQL Server</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#3599954</link><pubDate>Fri, 29 Jun 2007 11:18:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3599954</guid><dc:creator>SQL Server Users &amp; tools (SSQA)</dc:creator><description>&lt;p&gt;I was looking for more information on Table-Valued Functions (TVF) in SQL Server in attempting to perform&lt;/p&gt;
</description></item><item><title>Interesting post about Table Valued Functions</title><link>http://blogs.msdn.com/sqlclr/archive/2005/05/05/415034.aspx#4577656</link><pubDate>Sun, 26 Aug 2007 21:00:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4577656</guid><dc:creator>Niels SQL Server Blog</dc:creator><description>&lt;p&gt;Yesterday I wrote about that the SQLCLR team had started blogging, and today I saw their first &amp;quot;real&amp;quot;&lt;/p&gt;
</description></item></channel></rss>