May 4, 2023 at 7:13 pm
Did some searching, and the closest I've seen is using the SqlPackage command-line tool, either directly from CMD or through a PowerShell script.
I'm aware that in SSMS, you can do this by right-clicking and selecting "Import Data-tier Application". Is there any way to do this through a standard SQL script? Or is the only option to use xp_cmdshell to invoke SqlPackage?
May 5, 2023 at 1:52 pm
Through SQL? No. It's a command line driven process. Powershell is how I would do it. Check out DBATools.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
May 5, 2023 at 2:22 pm
Through SQL? No. It's a command line driven process. Powershell is how I would do it. Check out DBATools.
As a bit of a sidebar, it's a real shame that so many folks shy away from the proper and safe use of xp_CmdShell.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 5, 2023 at 3:17 pm
Grant Fritchey wrote:Through SQL? No. It's a command line driven process. Powershell is how I would do it. Check out DBATools.
As a bit of a sidebar, it's a real shame that so many folks shy away from the proper and safe use of xp_CmdShell.
Oh don't get me wrong - I'm not opposed to xp_cmdshell. Just wanted to see if there was anything more "out-of-the-box" that I wasn't aware of.
I suppose, internally, this is probably due to the fact that the exporting of the data-tier application is driven by a powershell script to begin with.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply