September 8, 2016 at 10:12 am
Example:
USE DatabaseA
SELECT * INTO Table1 FROM V_View1
SELECT * INTO Table2 FROM V_View2
SELECT * INTO DatabaseB.dbo.Table3 FROM V_View3
Would the above create Table 3 in Database B, while creating Table 1 and Table 2 in Database A? Database A and Database B are both on the same server instance.
September 8, 2016 at 10:30 am
What happened when you tried it?
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
September 8, 2016 at 11:26 am
Just kept spinning, perhaps because View3 is rather large...or it could be that it doesn't really work, I've had that happen before too. I don't have my own test database to play with at the moment and I don't want to risk inadvertently messing anything up on the company DBs. I'm about 90% sure that the SQL I posted originally works as I intend it to, but I want to be extra cautious before I update the script. It may be that my Google-Fu is not very strong, but I wasn't able to find any sufficiently similar posts out there.
October 31, 2016 at 6:24 am
best to run query and check, use top 10 to reduce time. i have done that on my pc and it does create table in database B.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply