473,434 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

Backup SQL Server Database via Visual Basic Code

114 100+
guys, what is the idea to backup sql server databse via visual basic code. And i also want the code please.
Apr 16 '08 #1
4 10297
debasisdas
8,127 Expert 4TB
Do you know how to take backup of SQL Server using Batch file ?
Apr 16 '08 #2
raaman rai
114 100+
Do you know how to take backup of SQL Server using Batch file ?
sorry i must say i havent gone thro' it. if u could explain i would be grateful.
Apr 16 '08 #3
debasisdas
8,127 Expert 4TB
Please find a related discussion here .
Apr 16 '08 #4
debasisdas
8,127 Expert 4TB
First create a batch file called backup.bat (It first deletes the existing
backup file, then make a call for the sql command);

c:
cd\backup
del samincbu.bak
sqlcmd -i c:\backup\backup.sql

Then create the T-SQL commands in the file backup.sql, as indicated in
the batch file;

EXEC sp_addumpdevice 'disk', 'samincbu',
'c:\Backup\samincbu.bak'
BACKUP database saminc TO samincbu
GO


Finally you need to call the batch file from VB using SHELL function.
Apr 16 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: James | last post by:
HI, I'm looking for a script that will allow users/admins to have a one click backup solution for a MYSQL Database.. 'BACK DATABASE' button, click and its done... The a restore option, that...
4
by: Neil | last post by:
Hi, I hope this question isn't too far off topic....I'm almost at my wits end trying to figure this out. I have a Mysql database and I wish to automate the backup of the database because I...
12
by: siliconmike | last post by:
How do I synchronize MySQL table data of my home PC with latest data from a remote server ? My home PC is on a very slow internet connection, so implementing replication will cause long time...
1
by: Fabius | last post by:
Hello, i'm trying to transfer a DB2 database from a PC to another. Following suggestion that Mr. Jan M. Nelken and Mr. Pierre Saint-Jacques give me on this newsgroup i first made a backup of...
5
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems;...
2
by: Recep TARAKÇI | last post by:
hi we want to backup database using visual basic 2005. thanks
0
by: sajijkumar | last post by:
How can I take backup of the database to flash drive. I used a Dir and Drive list box controls to select the perticular dir, and Wrote the code, Shell "command.com /c copy " & App.Path &...
13
by: NDayave | last post by:
How do, For backing up my database(Access 2000), i am trying to just back up the tables and their data, as this will save on space and allow for importing back into the actual database. I want the...
2
by: Chandrajit | last post by:
Hi How we can take run time database back using Visual Basic 6.0. For SQL Server and Access database.
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.