Click here to Skip to main content
15,895,011 members
Articles / Database Development / SQL Server / SQL Server 2008

Binary Copy files in T-SQL with helps of CLR

Rate me:
Please Sign up or sign in to vote.
4.17/5 (4 votes)
22 Jan 2013CPOL3 min read 14.7K   8   10  
Managing SQL backups can be more simple by using this FileRelay CLR
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace kladna.sql.clr
{
    class Program
    {
        static void Main(string[] args)
        {

            FileRelay.Copy("levente_first_test", @"\\lddevctxrepdb1\Temporary Short Term\cortex_20121211.bak4",
                            @"D:\Temporary Short Term\cortex_20121211_copy.bak"
                            , @"Data Source=LDDEVCTXREPDB1\Instance2;Initial Catalog=master;User Id=sa;Password=Passw0rd1;"
                            , 10);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Database Developer
Hungary Hungary
2010-2012 - DB. Architect & Senior DB. Developer - www.livejasmin.com
2008-2010 - Senior DB. Developer - www.logmein.com
2006-2008 - DBA & DB. Developer - www.eurotaxglass.co.uk

Comments and Discussions