Re: execute a t-sql code from outer files
- From: Eric Isaacs <eisaacs@xxxxxxxxx>
- Date: Thu, 8 Jan 2009 09:39:07 -0800 (PST)
Executing the T-SQL within a file can be done with T-SQL, but really
you would probably find it easier to do it in another programming
language. The file IO features in T-SQL are fine, but when you decide
that you want to move the processed files to a different folder,
delete them, or rename them, or whatever T-SQL starts to make those
types of operations more difficult than most computer languages. You
have a line in there that says "//some code." This to me implies that
you need to execute code beyond just T-SQL. If you need to do
anything other than T-SQL or you need to do anything with the files
after they've been executed, I would suggest picking your favorite
computer language over T-SQL, but if you just want to read those files
and execute the T-SQL without changing the files, T-SQL will work.
You can execute the T-SQL via ADO.NET from any of the .NET languages.
You can bulk insert the lines in the file into a temp table, then
process the lines into a variable and execute that string in T-SQL
too. But you would probably find the programming language approach to
be the easiest.
-Eric Isaacs
www.jstreettech.com
.
- References:
- execute a t-sql code from outer files
- From: lszk
- execute a t-sql code from outer files
- Prev by Date: DTS in SQL 2008 (Integration Services?)
- Next by Date: Re: DTS in SQL 2008 (Integration Services?)
- Previous by thread: execute a t-sql code from outer files
- Next by thread: Re: execute a t-sql code from outer files
- Index(es):
Relevant Pages
|