copying bulk data from one sql server to other

I have to copy about a million of records from one sql server (sql 2005) to another every day. I tried using the ssis package, but ended up locking the source table.
What would be the bestl way of doing this with out any affect on the performance of the source database.
Could I use the backup created on the source database to copy data to the dest. I wnat to copy only one day's worth of data
varsha2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Som TripathiDatabase AdministratorCommented:
You can try to use a query instead of table name. Add table hint nolock along with the query.
For example
Select * from table (nolock)
0
varsha2Author Commented:
The query had (nolock), but since I am querying over a million of records sql server escallated it to a table lock
0
Leo TorresSQL DeveloperCommented:
So in one day there are 1 million records
I would write a loop to insert records in batches of 10,000 or something

You will need an ID coulmn that counts each record from 1 to X

would look something like this

Declare @ncount int
Declare @Interval int
Declare @rCount int

Select @ncount  = Count(1) from TableX

SET @Interval = 10000
SET @rCount  = 0

While @rCount <= @ncount

Set @rCount  = @rCount + @Interval

Insert into TableY
Select Field1, Field2
where ID <= @rCount

loop


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

EE_AutoDeleterCommented:
I've requested that this question be deleted for the following reason:

                           
No comment has been added to this question in more than 21 days, so it is now classified as abandoned and is now flagged for deletion.


If there is a valid solution, please OBJECT and indicate the comments that are, or would otherwise lead to, a solution.


Use the specific format https:#axxxxxxxx for comment ID(s).


Also, please don't object simply because the author did not respond to your comment. While we understand this is frustrating, unfortunately we cannot force the author to return to the question. Unless you feel you have presented a valid, verifiable solution we'll simply delete the question.


Experts-Exchange Auto Deleter
0
Leo TorresSQL DeveloperCommented:
Did you try my recommendation. It has always worked for me. Let me know if I can be of any help.
0
Leo TorresSQL DeveloperCommented:
The method above will always work done correctly. I can provide further assistance if needed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.