开发者

Sql 2008 code to open file

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜