Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 7th, 2003, 04:21 PM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Location: Toronto, ON, Canada.
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
Reply With Quote
  #2 (permalink)  
Old October 7th, 2003, 07:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
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
Reply With Quote
  #3 (permalink)  
Old October 8th, 2003, 10:17 AM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Location: Toronto, ON, Canada.
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
Reply With Quote
  #4 (permalink)  
Old October 8th, 2003, 10:40 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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.
Reply With Quote
  #5 (permalink)  
Old October 8th, 2003, 02:45 PM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Location: Toronto, ON, Canada.
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
Reply With Quote
  #6 (permalink)  
Old October 8th, 2003, 03:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:08 PM.


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