-1

SQL Server Management Studio does not support LocalDB, so I can only use it to export the data on the server. I can export the schema via scripts and the data (but only table by table) with csv for instance. But that is lot of work.

What is the best way to access LocalDB?

Is there a free or open source tool for migration or access of LocalDB?

This is the source from MS stating that SSMS does not support LocalDB:

https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-ver16

Restrictions LocalDB cannot be managed remotely via SQL Management Studio.

Actually, it is possible to connect LocalDB locally with the right connection string.

citykid
  • 9,916
  • 10
  • 55
  • 91
  • Does this answer your question? [How to connect to LocalDb](https://stackoverflow.com/questions/12534454/how-to-connect-to-localdb) – Igor Oct 05 '22 at 15:25
  • 1
    "SQL Server Management Studio does not support LocalDB" <- Not sure why you think that? Or maybe you mean there is a specific feature that you can't access on a LocalDB instance from SSMS? – Igor Oct 05 '22 at 15:26
  • 1
    ***OF COURSE*** SSMS support LocalDB - that's just a special version of SQL Server Express after all. Point is: the LocalDB instances aren't started up at system startup - you need to manually start them using the `sqllocaldb` command line utility. Once started up, you can **OF COURSE** connect to any of those in SSMS and do everything you normally do with a SQL Server instance! – marc_s Oct 05 '22 at 16:22
  • https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-ver16 – citykid Oct 05 '22 at 18:37
  • thx so much @Igor after many attempts i got it done. Connection failed many times until I entered "additional connectionsettings" in the ssms dialog that i copied from visual studio. – citykid Oct 05 '22 at 18:55
  • Discussion not possible, wrong assumption – citykid Oct 05 '22 at 19:07

1 Answers1

1

One method to copy a database to localdb is with a BACPAC file, which includes schema and data.

To create a BACBAC for the source database in SSMS, right-click on the source database in SSMS Object Explorer, select Tasks-->Export Data Tier Application, click Next, and specify the target BACBAC file name in the dialog box.

Once the BACBAC is created, connect to your localdb target instance in SSMS Object Explorer, right-click the Databases node, select Import Data Tier Application, click Next, and specify the previously create BACPAC file.

Dan Guzman
  • 43,250
  • 3
  • 46
  • 71