SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to retrive exact data from table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mohan123
Constraint Violating Yak Guru

India
252 Posts

Posted - 12/12/2012 :  04:02:44  Show Profile  Reply with Quote
hello all,

i need to retrive exact data basing on date from users table.I have 10 lakhs records in which i need to pick up only 2 lakh records which inserted on Nov 30 2012 by using this query
i got the records
select * from patients where convert(date,CreatedDate) = '2012-11-30' order by 1 desc
but how can i get the these 2 lakh records and move into another server...with in 10 lakhs i need only 2 lakhs and i need to move to another server

P.V.P.MOhan

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 12/12/2012 :  04:24:49  Show Profile  Reply with Quote
Case1:
First of all, you need to connect to Server B.
Once connected, you need to link Server A to Server B. In SQL Mngmt Studio , this can be done by right-clicking Linked Servers under the Server Objects field and adding the new linked server.
Then you need to run a query similar to the one below.

INSERT INTO ServerB.DatabaseName.dbo.TableName
(SELECT * FROM ServerA.DatabaseName.dbo.TableName)

Where ServerA is the server name of Server A, similar for ServerB and DatabaseName is the name of the databases on each server

Case2: By using Import/Export wizard (If you have difficulty with linked server)
First insert your required data into another table
And then use this table with Import/export wizard


--
Chandu

Edited by - bandi on 12/12/2012 04:38:23
Go to Top of Page

mohan123
Constraint Violating Yak Guru

India
252 Posts

Posted - 12/12/2012 :  05:01:37  Show Profile  Reply with Quote
exactly case 2 i have did chandu thanks a Ton !!!

P.V.P.MOhan
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 12/12/2012 :  05:27:23  Show Profile  Reply with Quote
quote:
Originally posted by mohan123

exactly case 2 i have did chandu thanks a Ton !!!

P.V.P.MOhan


Welcome

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000