microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
334 stars 58 forks source link

Allow user to restore a database into container once container already running #304

Open stuartpa opened 1 year ago

stuartpa commented 1 year ago

It would be good to have a way for the user to use sqlcmd to restore another database into the container post create.  while the --using is functional on the create, if I wanted to restore something else into the container I have to futz with things to make it work and if you aren't a container person that might be difficult.   

stuartpa commented 1 year ago

Something like:

sqlcmd ingest https://aka.ms//aw.bak sqlcmd ingest https://aka.ms//aw.bacpac sqlcmd ingest https://aka.ms//aw.zip (containing .mdf/.ldf) 

And sqlcmd does the right thing based on file type. ingest isn't the right verb.

shueybubbles commented 1 year ago

restore or attach or import ? alias all of them together?

stuartpa commented 1 year ago

I think we are closing on use, e.g.

sqlcmd use https://aka.ms/aw.bak

By default this will update the default database, if flag --set-default-database:false is set, then default database would not be updated.

shueybubbles commented 1 year ago

will non-container on-prem instances have parity for restoring?