1

Situation: I have 2 azure database on the same server. All I need is to copy all tables(with data) from one db to another. How can I make this with query help? I wasn't able to found any answer for it.

2
  • You should be able to find your luck if you search for dump/import/export/backup/restore with azure database. You want this done only once correct? If you need to have two instances having same data you should search for replication Commented Oct 31, 2013 at 13:34
  • Possible duplicate of SQL Azure - copy table between databases Commented Jan 5, 2017 at 10:28

2 Answers 2

3

I don't think you can do it with query. Check out Import and Export Data program that follows sql management studio. I think it's called DTSWizard.exe. Anyway, it can copy stuff from pretty much any source.

Sign up to request clarification or add additional context in comments.

1 Comment

Well, I didn't found easiest way except simply making database backup =_=. Thanks anyway.
1

You can use the CREATE DATABASE AS COPY OF command, like this:

CREATE DATABASE destination_database_name AS COPY OF
[source_server_name.]source_database_name

Same-Server Copying

When you copy a database to make a new database on the same SQL Database server, the same logins can be used on both databases. The security principal you use to copy the database becomes the database owner (DBO) on the new database when it is created. After the copy is complete, the destination database becomes a fully functional, independent database. The logins, users, and permissions of the destination can be managed independently of the source database.

Cross-Server Copying

You can also copy a database between two different SQL Database servers that are in the same sub-region or data center. Because the new database is created on a different SQL Database server, it is associated with a different master database. All users in the new database maintain the permissions that they had in the source database. The security principal you use to copy the database becomes DBO on the new database when it is created and is assigned a new security identifier (SID).

For more info, see this link: http://msdn.microsoft.com/en-us/library/ff951624.aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.