473,387 Members | 1,374 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,387 software developers and data experts.

SQL Server Table Backup

RLN
Anybody know how to backup a table with particular range.

Ex one column contains date..

I need to backup only data belong from date to date.
is is possible via programming in C?

if yes give example ( don`t tell backup SQL command)

RLN

Jul 23 '05 #1
2 1408
You can't selectively backup rows using SQL BACKUP. What you could do
is copy the required data to another database and then back that up:

INSERT INTO BackupDB.dbo.YourTable (col1, col2, ...)
SELECT col1, col2, ...
FROM YourDB.dbo.YourTable
WHERE date_col >= '20040101'
AND date_col < '20050101'

You can drive this based on the current date for example and then use
it as a regular archiving process.

--
David Portas
SQL Server MVP
--

Jul 23 '05 #2

"David Portas" <RE****************************@acm.org> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
You can't selectively backup rows using SQL BACKUP. What you could do
is copy the required data to another database and then back that up:

INSERT INTO BackupDB.dbo.YourTable (col1, col2, ...)
SELECT col1, col2, ...
FROM YourDB.dbo.YourTable
WHERE date_col >= '20040101'
AND date_col < '20050101'

You can drive this based on the current date for example and then use
it as a regular archiving process.
Another idea is to use BCP with that sort of select statement to dump the
table contents to a file that can be backed up separately.


--
David Portas
SQL Server MVP
--

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Orlando | last post by:
Any help would be greatly appreciated. My problem is that I need to set up a backup SQL Server 2000 machine which can be used in case of a failure to my primary. All databases (30 as of now)...
19
by: Thue Tuxen Sørensen | last post by:
Hi everybody ! I´m maintaining a large intranet (approx 10000 concurrent users) running on one IIS box and one DB box with sqlserver 2000. Currently there is 2,5 GB Ram, 1 1400 mhz cpu and 2...
1
by: rcamarda | last post by:
I wish to create a user that can backup any or all databases in our SQL Server 2000 Instance. I thought there would be a server role for this function, however I can only find that after I grant...
4
by: TC | last post by:
Hello All, I apology for posting to many groups but I wasn't sure which group would be best targeted with my question. I have inherited an ASP.Net application that requires some maintenance &...
7
by: John | last post by:
Do you guys have any idea if web hosting companies usually give access to SQL Server databases through Enterprise Manager? I used to have have access to my DB through EE with my previous provider...
0
by: MikeB | last post by:
Problem : I am maintaining a legacy application which is distributed with a default database, loaded from a file called Master.dat. I wish to update the values of 10 fields in 1 table. I...
6
by: Antoni | last post by:
Hello, I'm trying to make a daily database backup. When executing "mysqldump - uxxx -pxxx database /home/backup/ddbb.sql -q &" the httpd server gets blocked and my site is "offline" for 30...
2
by: m19peters | last post by:
We have a script that I had to rework a little bit for 2005 that does a full backup for every database on the server... For some reason on some nights the script does not backup all databases......
10
by: =?Utf-8?B?UHVuaXQgS2F1cg==?= | last post by:
Hi, I am developing a windows application in VS.NET 2005. The application is database driven and I need to deploy it on a client's pc. How should I go about developing such an application. I...
1
by: JA | last post by:
I am moving my site to a host that has SQL Server 2005. I am pretty good with Access, but I don't know much about SQL Server. I'm currently using SQL Server 2000, and I access it with Access...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.