Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have one table like 'customer' with have 10 records. i want to archive in 5 records.
Finally i want to execute that table like 'select * from customer, then it will display 10 records(5 records are in customer and 5 records are in arching location).
is it possible to get all records..?

can you please help me.
thanks in advance
Posted

1 solution

1) If you archiving the table to the same server and different database, you can just retreive the results with a database.dbowner synatx. For Eg: -

select * from [Servername].[OriginalDatabase].dbo.[OriginalTable]
union all
select * from [Servername].[ArchivalDatabase].dbo.[ArchivedTable]

2) If the archived db is in different server. Please use the linked server option in sql and run the above query.
 
Share this answer
 
Comments
K N R 17-Oct-11 9:28am    
hey shijuse,
i am not maintain archive data in same database or another database. It will be another like notepad or xml files.
shijuse 17-Oct-11 9:37am    
How you are writting archived data to notepad/xml (BCP/For xml command?)
K N R 17-Oct-11 9:56am    
ya am using bcp command

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900