PowerShell script exchange
Post Reply
inoisikoiski
Influencer
Posts: 17
Liked: never
Joined: Apr 12, 2019 9:55 am
Full Name: Inoi Visp
Contact:

SQL object level restore using PS

Post by inoisikoiski » Apr 15, 2019 10:13 am

Hello,
Just wondering whether there's a script to do a sql object level restore please.
Thanks

HannesK
Veeam Software
Posts: 3698
Liked: 441 times
Joined: Sep 01, 2014 11:46 am
Location: Austria
Contact:

Re: SQL object level restore using PS

Post by HannesK » Apr 15, 2019 1:40 pm

Hello,
all available powershell cmdlets for SQL Explorer can be found in https://helpcenter.veeam.com/docs/backu ... l?ver=95u4 . Could you specify what kind of "objects" you mean?

If databases, that's possible with Restore-VESQLDatabase

Best regards,
Hannes

inoisikoiski
Influencer
Posts: 17
Liked: never
Joined: Apr 12, 2019 9:55 am
Full Name: Inoi Visp
Contact:

Re: SQL object level restore using PS

Post by inoisikoiski » Apr 15, 2019 1:58 pm

Thanks Hannes. What I meant by sql object level restore is such as tables, stored procedures, etc. I got a response previously from foggy on a similar post and he said there is no script to do a sql object level restore :(

HannesK
Veeam Software
Posts: 3698
Liked: 441 times
Joined: Sep 01, 2014 11:46 am
Location: Austria
Contact:

Re: SQL object level restore using PS

Post by HannesK » Apr 15, 2019 2:14 pm

sorry, if foggy says so, then it is the way it is... he knows these things ;-)

veremin
Product Manager
Posts: 16710
Liked: 1396 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: SQL object level restore using PS

Post by veremin » Apr 15, 2019 6:14 pm

Correct, you cannot restore SQL items, such as tables, procedures, etc. using PowerShell. Thanks!

inoisikoiski
Influencer
Posts: 17
Liked: never
Joined: Apr 12, 2019 9:55 am
Full Name: Inoi Visp
Contact:

Re: SQL object level restore using PS

Post by inoisikoiski » Apr 16, 2019 8:23 am

Cheers!

tsightler
VP, Product Management
Posts: 5383
Liked: 2217 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: SQL object level restore using PS

Post by tsightler » Apr 18, 2019 5:55 pm 1 person likes this post

I wouldn't say you cannot do it, I'd say you cannot do it with Veeam Powershell. However, you can use Publish-VESQLDatabase and then use standard SQL tools to copy whatever you want. Personally, for copying tables, I highly recommend the dbatools Powershell module:

https://github.com/sqlcollaborative/dbatools

They have a nice command, Copy-DbaDbTableData, which makes copying tables between databases quite easy and fast using BCP. For stored procedures or other, more complex objects and relationships, you might have to get a little more creative, but there are plenty of examples for all of these because it's no different than copying between any two databases.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests