Discussion:
oracle's UTL_FILE in SQL server????
(too old to reply)
Chandra
2005-08-30 06:53:03 UTC
Permalink
what is the alternative for oracle's UTL_FILE in SQL server
Chandra
2005-08-30 07:06:03 UTC
Permalink
Hi

You dont have anything like UTL_FILE in SQL Server.

If you want the output to be returned to a disc,

in the query analyer tool,
from the Menu Query > Result to File

if u execute the query in the query analyser, it promps you to output the
file to a flat file
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
what is the alternative for oracle's UTL_FILE in SQL server
Chandra
2005-08-30 07:10:01 UTC
Permalink
or probably this can help you:

http://seclists.org/lists/pen-test/2002/Mar/0049.html
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
Hi
You dont have anything like UTL_FILE in SQL Server.
If you want the output to be returned to a disc,
in the query analyer tool,
from the Menu Query > Result to File
if u execute the query in the query analyser, it promps you to output the
file to a flat file
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
what is the alternative for oracle's UTL_FILE in SQL server
Chandra
2005-08-30 07:15:05 UTC
Permalink
--Open file for writing
v_OutputFileHandle:=UTL_FILE.FOPEN(FileDirectory,FileName,'w',32767);
UTL_FILE.put_line(v_OutputFileHandle,'REM All Rights Reserved.');

I need to migrate the above lines from Pl/SQL to T-SQL for the same
functionality.

Any help??
Post by Chandra
Hi
You dont have anything like UTL_FILE in SQL Server.
If you want the output to be returned to a disc,
in the query analyer tool,
from the Menu Query > Result to File
if u execute the query in the query analyser, it promps you to output the
file to a flat file
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
what is the alternative for oracle's UTL_FILE in SQL server
Chandra
2005-08-30 07:27:10 UTC
Permalink
Yes, I can understand that,
but UTL file cannot be used in SQL Server.

you can try this which is similar:

exec master..xp_cmdshell 'isql -U [username] -P [password] -S . -d pubs -q
"select * from employee" -o "c:\result.sql"'

please remember that the options are case sensitive. try executing the query
and u see the output in the file result.sql in the folder "C"

please let me know if u have any questions

please substitute usrname and pwd also
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
--Open file for writing
v_OutputFileHandle:=UTL_FILE.FOPEN(FileDirectory,FileName,'w',32767);
UTL_FILE.put_line(v_OutputFileHandle,'REM All Rights Reserved.');
I need to migrate the above lines from Pl/SQL to T-SQL for the same
functionality.
Any help??
Post by Chandra
Hi
You dont have anything like UTL_FILE in SQL Server.
If you want the output to be returned to a disc,
in the query analyer tool,
from the Menu Query > Result to File
if u execute the query in the query analyser, it promps you to output the
file to a flat file
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
what is the alternative for oracle's UTL_FILE in SQL server
Chandra
2005-08-30 09:21:03 UTC
Permalink
I typed in my local Query analyser the following statement

exec master..xp_cmdshell 'isql -U sa -P sa -S . -d pubs -q
"select * from employee" -o "c:\result.sql"'

after executing this statement it did not create any result.sql in C.
in the output pane, there is one columnwith name 'output' and in that there
is one row with value "1>"

what's wrong with this statement?
Post by Chandra
Yes, I can understand that,
but UTL file cannot be used in SQL Server.
exec master..xp_cmdshell 'isql -U [username] -P [password] -S . -d pubs -q
"select * from employee" -o "c:\result.sql"'
please remember that the options are case sensitive. try executing the query
and u see the output in the file result.sql in the folder "C"
please let me know if u have any questions
please substitute usrname and pwd also
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
--Open file for writing
v_OutputFileHandle:=UTL_FILE.FOPEN(FileDirectory,FileName,'w',32767);
UTL_FILE.put_line(v_OutputFileHandle,'REM All Rights Reserved.');
I need to migrate the above lines from Pl/SQL to T-SQL for the same
functionality.
Any help??
Post by Chandra
Hi
You dont have anything like UTL_FILE in SQL Server.
If you want the output to be returned to a disc,
in the query analyer tool,
from the Menu Query > Result to File
if u execute the query in the query analyser, it promps you to output the
file to a flat file
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
what is the alternative for oracle's UTL_FILE in SQL server
Chandra
2005-08-30 10:09:02 UTC
Permalink
Hi Anil
Please check that the result sql file will be saved in the directory of SQL
Server.
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
I typed in my local Query analyser the following statement
exec master..xp_cmdshell 'isql -U sa -P sa -S . -d pubs -q
"select * from employee" -o "c:\result.sql"'
after executing this statement it did not create any result.sql in C.
in the output pane, there is one columnwith name 'output' and in that there
is one row with value "1>"
what's wrong with this statement?
Post by Chandra
Yes, I can understand that,
but UTL file cannot be used in SQL Server.
exec master..xp_cmdshell 'isql -U [username] -P [password] -S . -d pubs -q
"select * from employee" -o "c:\result.sql"'
please remember that the options are case sensitive. try executing the query
and u see the output in the file result.sql in the folder "C"
please let me know if u have any questions
please substitute usrname and pwd also
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
--Open file for writing
v_OutputFileHandle:=UTL_FILE.FOPEN(FileDirectory,FileName,'w',32767);
UTL_FILE.put_line(v_OutputFileHandle,'REM All Rights Reserved.');
I need to migrate the above lines from Pl/SQL to T-SQL for the same
functionality.
Any help??
Post by Chandra
Hi
You dont have anything like UTL_FILE in SQL Server.
If you want the output to be returned to a disc,
in the query analyer tool,
from the Menu Query > Result to File
if u execute the query in the query analyser, it promps you to output the
file to a flat file
--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------
Post by Chandra
what is the alternative for oracle's UTL_FILE in SQL server
Loading...