Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Accessing the file of a T-SQL BACKUP call

Accessing the file of a T-SQL BACKUP call

Scheduled Pinned Locked Moved Database
csharpdatabasequestionsql-serverwinforms
5 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uwe Keim
    wrote on last edited by
    #1

    Trying to provide a backup "button" inside the C# Windows Forms application on a client PC that connects to a SQL Server database, I want to grab the resulting backup file of a call to the BACKUP DATABASE [^] T-SQL function. Since the BACKUP DATABASE function takes a file path that is relative to the SQL Server itself, I see no reliable way to get the resulting backup file from the client. My ideal way would be: 1.) Call the BACKUP DATABASE function from my client application. 2.) Specify to backup to a local file (or even better: a C#/.NET stream[^]). 3.) Capture the resulting BAK file from my client application. Question: Is this possible to achieve? (I will cross-post this message to the C# forum, since I am unsure whether this is more an ADO.NET topic) Thanks Uwe

    • My personal 24/7 webcam • Zeta Test - Intuitive, competitive Test Management environment for Test Plans and Test Cases. Download now! • Zeta Producer Desktop CMS - Intuitive, very easy to use. Download now!

    S V 2 Replies Last reply
    0
    • U Uwe Keim

      Trying to provide a backup "button" inside the C# Windows Forms application on a client PC that connects to a SQL Server database, I want to grab the resulting backup file of a call to the BACKUP DATABASE [^] T-SQL function. Since the BACKUP DATABASE function takes a file path that is relative to the SQL Server itself, I see no reliable way to get the resulting backup file from the client. My ideal way would be: 1.) Call the BACKUP DATABASE function from my client application. 2.) Specify to backup to a local file (or even better: a C#/.NET stream[^]). 3.) Capture the resulting BAK file from my client application. Question: Is this possible to achieve? (I will cross-post this message to the C# forum, since I am unsure whether this is more an ADO.NET topic) Thanks Uwe

      • My personal 24/7 webcam • Zeta Test - Intuitive, competitive Test Management environment for Test Plans and Test Cases. Download now! • Zeta Producer Desktop CMS - Intuitive, very easy to use. Download now!

      S Offline
      S Offline
      scottgp
      wrote on last edited by
      #2

      On the link you included for the BACKUP command documentation, you'll see a section named "Backup History Tables". You can try reading those system tables - it looks like physical_name in the backupfile system table might have what you want. Scott

      U 1 Reply Last reply
      0
      • S scottgp

        On the link you included for the BACKUP command documentation, you'll see a section named "Backup History Tables". You can try reading those system tables - it looks like physical_name in the backupfile system table might have what you want. Scott

        U Offline
        U Offline
        Uwe Keim
        wrote on last edited by
        #3

        Thank you, Scott! I will try to investigate. The idea was to have the user do ZERO configuration, except specifying the connection string. Hopefully I will manage to do. Cheers Uwe

        • My personal 24/7 webcam • Zeta Test - Intuitive, competitive Test Management environment for Test Plans and Test Cases. Download now! • Zeta Producer Desktop CMS - Intuitive, very easy to use. Download now!

        1 Reply Last reply
        0
        • U Uwe Keim

          Trying to provide a backup "button" inside the C# Windows Forms application on a client PC that connects to a SQL Server database, I want to grab the resulting backup file of a call to the BACKUP DATABASE [^] T-SQL function. Since the BACKUP DATABASE function takes a file path that is relative to the SQL Server itself, I see no reliable way to get the resulting backup file from the client. My ideal way would be: 1.) Call the BACKUP DATABASE function from my client application. 2.) Specify to backup to a local file (or even better: a C#/.NET stream[^]). 3.) Capture the resulting BAK file from my client application. Question: Is this possible to achieve? (I will cross-post this message to the C# forum, since I am unsure whether this is more an ADO.NET topic) Thanks Uwe

          • My personal 24/7 webcam • Zeta Test - Intuitive, competitive Test Management environment for Test Plans and Test Cases. Download now! • Zeta Producer Desktop CMS - Intuitive, very easy to use. Download now!

          V Offline
          V Offline
          Vimalsoft Pty Ltd
          wrote on last edited by
          #4

          Good Day Uwe Someone asked a very same questions weeks ago and i have given an answer. please search anything by me here on CP.

          Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

          U 1 Reply Last reply
          0
          • V Vimalsoft Pty Ltd

            Good Day Uwe Someone asked a very same questions weeks ago and i have given an answer. please search anything by me here on CP.

            Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

            U Offline
            U Offline
            Uwe Keim
            wrote on last edited by
            #5

            Thanks! If found this one [^] and several others [^]. But seem to have no match :-( Anyway, I keep searching for a match :-)

            • My personal 24/7 webcam • Zeta Test - Intuitive, competitive Test Management environment for Test Plans and Test Cases. Download now! • Zeta Producer Desktop CMS - Intuitive, very easy to use. Download now!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups