Equivalent of UTL_FILE of oracle in MSSQL
Hi all,

I am currently migrating my database from oracle to MSSQL. My problem is that i have encountered the UTL_FILE function in Oracle and i am not finding its equivalent for MSSQL.

Can anyone help me with this plz? Is there any other way of reading and writting OS files in MSSQL?

Regards
Dhiraj
Software Engineer.
April 25th, 2008 4:12pm

Actually, the equivalent to UTL_FILE is extended stored procedures:

Almost all of the UTL_FILE procedures are thin wrappers over basic file io operations. If you use the CLR and write your own extended stored procedure or assembly/type then you can get this functionality and much more. Because SQL Server can interpret and execute dlls in context of either a procedure or a type, this particular Oracle feature is just a subset of what the built-in CLR can do. An example of CLR use for an extended stored procedure can be found below.

http://www.codeproject.com/KB/database/xp_md5.aspx

Hope that helps,

John

Free Windows Admin Tool Kit Click here and download it now
April 25th, 2008 7:58pm

There is not a direct option to achieve the flexibility of utl_file package.

But other way arounds can be

using XP_Cmdshell

CLR routines.

It is better to design custom CLRs wich can be more flexible and powerfull.

September 25th, 2013 5:20am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics