Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6047563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:21:53+00:00 2026-05-23T07:21:53+00:00

I am using the following query to take backup with backup file name as

  • 0

I am using the following query to take backup with backup file name as current timestamp and path as selected by the user(stored in labelbackupPath).

    UtilityClass.ExecuteQuery(@"Declare @file_name varchar(500);
                                set @file_name = CURRENT_TIMESTAMP;
                                BACKUP DATABASE VegiManager to DISK CONCAT(@pathname,@file_name);", true, new SqlParameter("@pathname", labelbackupPath.Text + @"\"));

Here is the signature of ExecuteQuery:

  public static int ExecuteQuery(String query, bool showMsgBox, params SqlParameter[] parameters)

It just executes the specified query adding the specified parameters to the SqlCommand. If showMsgBox is true, it ask for confirmation and gives the result of query execution.

There is some error in the TSql part, please suggest where am I wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:21:53+00:00Added an answer on May 23, 2026 at 7:21 am

    CONCAT is not a valid TSQL statement.

    You would just append the strings with @pathname + @file_name

    I would personally put this backup information into a stored proc and just execute this with parameters passed in.

    Also best if doing in code use SQL SMO
    e.g http://social.msdn.microsoft.com/forums/en-US/sqlexpress/thread/95750bdf-fcb1-45bf-9247-d7c0e1b9c8d2/

    Note: The user executing would also require backup permissions and the path needs to be available to server i.e if you backup to C:\temp this is on the server not the machine running the backup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following query which works fine for me except one problem SELECT
Using the following query and results, I'm looking for the most recent entry where
Using the following query: SELECT pe.prodtree_element_name_l, MAX(rs.resource_value) AS resource_value FROM prodtree_element pe LEFT JOIN
I am using the following query to display database rows in an alphabetical order:
i've been using the following query: select LEN(columnname) as columnmame from dbo.amu_datastaging This works,
I have a SqlDependency set up using the following query: string sql = "SELECT
I am getting random row from my table using the following query: SELECT value_id
I'm using the following HQL query to try and load a set of objects
I cannot figure out how to write the following query using the DbFinderPlugin 1.2.2
In my repository implementation I can run the following query using a lambda expression:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.