Reputation: 592
I am trying to configure Azure Storage Emulator 2.4 work with Local SQL server 2012.
When I execute this command, I get cannot create Database.
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator.exe init -server ThisPC -sqlinstance SQLEXPRESS -forcecreate
Windows Azure Storage Emulator 3.3.0.0 command line tool
Error: Cannot create database.
To my Sql Sever Manager I login using server name ThisPC\SQLEXPRESS.
Please help me on which information i have missed.
----------------- Updated -----------------
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator.exe init -server (local)\SQLExpress -forcecreate
Windows Azure Storage Emulator 3.3.0.0 command line tool Error: Cannot create database.
If you look at AppData\Local\WAStorageEmulator\WAStorageEmulator.3.3.config you'll find:
<SQLInstance>(local)\SQLExpress</SQLInstance>
Thanks to Gaurav on reminding me on logs, I checked my Event Viewer:
Cannot create file 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\WAStorageEmulatorDb33.mdf' because it already exists
It said the SQL DB files exists, so deleted it and retried the command, worked fine and storage emulator also started. (command worked second attempt after some time might be some SQL cache issue)
Upvotes: 3
Views: 8285
Reputation: 173
I would like to propose an answer based on the information from the OP's post/comments for readers from the future who get here after a some searching.
It is quite easy, and really the main piece of pertinent information is that you must first delete the existing database file located at:
C:\Users\\WAStorageEmulatorDb33.mdf
Then you can reinitialize the emulator. So run the Azure Storage Emulator and initialize it with your desired SQL instance:
WAStorageEmulator.exe init -server (local)\SQLExpress
Things that can go wrong:
Upvotes: 8