Solved

How to mention NOLOCK during SSIS import and export wizard

Posted on 2009-07-08
5
902 Views
Last Modified: 2013-11-10
Hello experts,

I wanted to copy around 20 tables from one db to another using import and expoert wizard but without locking the source tables. Is there any option inside the wizard where in i can check that option or any other alternative?
Thanks
0
Comment
Question by:parpaa
  • 2
  • 2
5 Comments
 
LVL 20

Expert Comment

by:alainbryden
ID: 24805459
Copying entire tables can't not lock the source because of race conditions that could occur. If the table contents were copied over, and a new entry was made after the copy, and then the index was copied over, where the index has a reference to the new entry which wasn't copied over, then the copied table and index is corrupt. This is the only obvious example I can readily think of as to why the source tables need to be locked for the copy.

--
Alain
0
 
LVL 5

Expert Comment

by:rgc6789
ID: 24805776
You could select * Into MigrateTable1 From Table1 for each of the 20 or so tables and then use the Import/Export, or you can link the db's and do the same as above directly from one to the other.
0
 

Author Comment

by:parpaa
ID: 24806314
@alain - in my case i am copying whole table so u mean to say there wouldn't be any lock. i am testing it now and so far there is no lock and it still has to transfer around 100k rows
0
 
LVL 20

Accepted Solution

by:
alainbryden earned 200 total points
ID: 24840132
Well you said you were testing, did the transfer work without locking or no? Is there any issue you're having in accomplishing some task?

--
Alain
0
 

Author Comment

by:parpaa
ID: 24859672
Yes it worked, sorry for the late response, been busy..
Thanks!!
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now