title: How to set 'Enable identity insert' for all the tables at once during importing data in SQL Server?
body: <p>I am trying to copy a database from a remote server. I don't have access to its backups or file system. My destination database on my dev machine needs to get all the data plus the same tables structures including primary keys with identity settings and the rest of the constraints.</p>
  
  <p>The Import/Export facility has the option to set the identity insert as shown below but I have to do this manually per table. I have over 300 tables to copy and most of them have identity primary keys. This is going to be very painful process doing the copy multiple times.</p>
  
  <p>Is there a way to set this identity insert setting all at once for all the tables? Or some other reliable way of copying databases in such a setup? 
  I am using SSMS 7.3 against SQL Server 2014.</p>
  
  <p><a href="https://i.stack.imgur.com/fGntd.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fGntd.gif" alt="enter image description here"></a></p>