Question

I am playing with LocalDb from IIS. There are several instructions how to do that, e.g. https://stackoverflow.com/a/13768812/121968.

For what functionality LocalDb needs the user profile and other specific requirements? (It is possible, for instance, to tweak the Local LocalDb not to call SHGetKnownFolderPath?)

Was it helpful?

Solution

LocalDB needs the user profile because it stores instances in "%USERPROFILE%\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances". Usually all guides tell you to connect to (localdb)\v11. What is "v11"? It's the name of an instance that represented by the folder "%LOCALAPPDATA%\Microsoft\Microsoft SQL Server Local DB\Instances\v11".

So in fact a LocalDB database is not "just" a single file, it is also a bunch of files stored in the instance folder. You can play with it. For example

SqlLocalDB.exe create LocalDBIsAHoax
SqlLocalDB.exe start LocalDBIsAHoax
sqlcmd -S (localdb)\LocalDBIsAHoax
1> create database MySuperDuperDB
2> go
1> :exit
dir "%LOCALAPPDATA%\Microsoft\Microsoft SQL Server Local DB\Instances\LocalDBIsAHoax"

I don't know a mean to make LocalDB place its instances in some other place.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top