-
- Influencer
- Posts: 17
- Liked: never
- Joined: Apr 12, 2019 9:55 am
- Full Name: Inoi Visp
- Contact:
SQL object level restore using PS
Hello,
Just wondering whether there's a script to do a sql object level restore please.
Thanks
Just wondering whether there's a script to do a sql object level restore please.
Thanks
-
- Product Manager
- Posts: 14836
- Liked: 3083 times
- Joined: Sep 01, 2014 11:46 am
- Full Name: Hannes Kasparick
- Location: Austria
- Contact:
Re: SQL object level restore using PS
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
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
-
- Influencer
- Posts: 17
- Liked: never
- Joined: Apr 12, 2019 9:55 am
- Full Name: Inoi Visp
- Contact:
Re: SQL object level restore using PS
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
-
- Product Manager
- Posts: 14836
- Liked: 3083 times
- Joined: Sep 01, 2014 11:46 am
- Full Name: Hannes Kasparick
- Location: Austria
- Contact:
Re: SQL object level restore using PS
sorry, if foggy says so, then it is the way it is... he knows these things
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: SQL object level restore using PS
Correct, you cannot restore SQL items, such as tables, procedures, etc. using PowerShell. Thanks!
-
- Influencer
- Posts: 17
- Liked: never
- Joined: Apr 12, 2019 9:55 am
- Full Name: Inoi Visp
- Contact:
-
- VP, Product Management
- Posts: 6035
- Liked: 2860 times
- Joined: Jun 05, 2009 12:57 pm
- Full Name: Tom Sightler
- Contact:
Re: SQL object level restore using PS
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.
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.
Who is online
Users browsing this forum: No registered users and 12 guests