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 »

Hello,
Just wondering whether there's a script to do a sql object level restore please.
Thanks
HannesK
Product Manager
Posts: 14287
Liked: 2877 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: SQL object level restore using PS

Post by HannesK »

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 »

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
Product Manager
Posts: 14287
Liked: 2877 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: SQL object level restore using PS

Post by HannesK »

sorry, if foggy says so, then it is the way it is... he knows these things ;-)
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: SQL object level restore using PS

Post by veremin »

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 »

Cheers!
tsightler
VP, Product Management
Posts: 6009
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: SQL object level restore using PS

Post by tsightler » 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 12 guests