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?
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.
Hope that helps,
There is not a direct option to achieve the flexibility of utl_file package.
But other way arounds can be
It is better to design custom CLRs wich can be more flexible and powerfull.