Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2003, 04:21 PM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default Archiving query result

Hi,
Does anyone know how we can archive the records those come under the result a query? I appreciate,


-Ned
__________________
-Ned
 
Old October 7th, 2003, 07:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

What do you mean by "archive"?

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old October 8th, 2003, 10:17 AM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am looking for SQL Server built-in archive functionality so I don't have to write a program. I want to move 5 years old data from current database to another database.
If there's nothing in SQL then I will go head to do it programmatically.

-Ned
 
Old October 8th, 2003, 10:40 AM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is the archive going to be exactly the same as the existing db?

here is what I do - there may be better ways.
In Enterprise Manager - create a blank db (MyDB_Archive) on any sql server machine could be the same as the source db (MyDB) server.

Add all the same database users to Archive db.
Go to MyDB right click >
Export Data >
you will get DTS Export / Import Wizard >
Click next >
enter source db info - server name, sa user and password, select source db >
Next >
do the same for destination db >
next >
Select the bottom option "Copy objects and data between SQL Server databases" >
Next >
un-check the bottom check box "Use default options" >
Click the Options button >
un-check the first check box "Copy database users and database roles" >
OK >
Next >
Next >
double check your destination and source >
finish. - will take awhile depending on size of db.

hope this is what you are looking for?


If you do not care about maintaining permissions then you can skip adding the users to archive db, but you must also un-check the box "Copy object permissions" that is on the same screen as the "Copy database users and database roles" check box.
 
Old October 8th, 2003, 02:45 PM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can we do this process from the program? so that we can let the user to do that.

-Ned
 
Old October 8th, 2003, 03:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

DTS exposes several object models in several object libraries. You can (reasonably) easily manipulate these objects in code (VB, C++, etc).

See BOL table of contents for "Building SQL Server applications", "DTS Programming".

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Query does not produce desired result snufse SQL Server 2005 0 July 2nd, 2008 12:14 PM
Show result from query akibaMaila VB.NET 2002/2003 Basics 2 January 18th, 2005 12:43 PM
Unexpected result from the query tsimsha Classic ASP Databases 1 August 23rd, 2004 03:50 AM
display the result of query in textbox. Abhinav_jain_mca ADO.NET 4 August 3rd, 2004 03:34 AM
Query Result mateenmohd SQL Server 2000 0 November 1st, 2003 03:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.