CREATE DATABASE MyDatabase ON (NAME = MyDatabase_dat, FILENAME = 'E:\PortableSQL\Data\MyDatabase.mdf') LOG ON (NAME = MyDatabase_log, FILENAME = 'E:\PortableSQL\Data\MyDatabase_log.ldf'); GO
User Instances were deprecated after SQL Server 2012. Modern SQL Server Express (2014+) uses Contained Databases and AttachDbFileName without the "User Instance" flag, but again, the main service must be pre-installed. ms sql server express portable
If you require a database that runs strictly from a folder or USB drive with zero installation, you should consider these alternatives: Server Fault Portable SQL Server - Server Fault FILENAME = 'E:\PortableSQL\Data\MyDatabase_log.ldf')
SQL Server is a complex relational engine that relies on Windows services ( MSSQL$SQLEXPRESS ) and Registry keys (under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server ). ms sql server express portable