SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

usp_exec_tsql_strfile

By Clinton Herring, 2004/07/28

Total article views: 395 | Views in the last 30 days: 7

Executes a file containing T-SQL code without using OSQL. The file can be up to 80,000 characters. Each line in the file should be no more than 256 characters. (Customize the code as needed.) The DOS Type command is used to retrieve the code. Embedded "go"s are removed so don't expect termination behavior. The only parameter is a fully qualified file path passed as a 256 varchar string. Uses dynamic SQL to run the file. Runs in the context of the database your connected to when you call the proc unless the file code redirects it. Holding tables are real tables created in Tempdb and then dropped at the end of execution. This could cause problems in code that repeatedly calls the proc. Use at your on risk.

By Clinton Herring, 2004/07/28

Total article views: 395 | Views in the last 30 days: 7
Your response
 
 
Related tags
 
Like this? Try these...

RegExp find

By Maarten | Category: Miscellaneous
| 131 reads
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com