开发者

Sql 2008 code to open file

开发者 https://www.devze.com 2023-01-30 00:39 出处:网络
What is the SQL 2008 code to open a file, appen开发者_如何学JAVAd some new lines, and save the file.Is there a way to do this all inside a stored procedure?Also, is there a way to automatically retrie

What is the SQL 2008 code to open a file, appen开发者_如何学JAVAd some new lines, and save the file. Is there a way to do this all inside a stored procedure? Also, is there a way to automatically retrieve the script to do this from a "Tasks"->"Generate Scripts" menu options, or at least get close.


You can do it with plain T-SQL...

http://www.simple-talk.com/sql/t-sql-programming/reading-and-writing-files-in-sql-server-using-t-sql/

to make it work, click on those links in the text as well...

http://www.simple-talk.com/code/WorkingWithFiles/uftReadFileAsTable.txt

http://www.simple-talk.com/code/WorkingWithFiles/spWriteStringTofile.txt

Or you might write a function in c#...

http://blog.adampresley.com/2009/writing-csharp-functions-for-sql-server-and-clr-integration/

0

精彩评论

暂无评论...
验证码 换一张
取 消