How to upload Visual Studio SQL server LocalDB to Azure
You can migrate your on-premises database to Azure SQL database using SQL Server 2012(SQL Server 2017 and 2019 might face compatibility issues) and SQL Server Management Studio (SSMS).
Firstly, you need to attach your existing database with SSMS. Follow the link.
Follow the below steps in SSMS once your database attached.
- Right click on the database you want to migrate. Select Task and from dropdown options select Deploy Database to Microsoft Azure SQL Database
- Click on Next on pop-up window. On the very next window you will get options to connect your Azure SQL Server. Provide your Azure SQL server name, server credentials and click on Connect.
- Provide the database name you want to give in Azure SQL Server. Fill the Azure SQL Database settings as per your requirement. Click on Next.
- Lastly, you will get a summary of all the settings you have done. Click on Finish to migrate the database.
- Once your database migrated successfully, you will get summary with Operation Complete message. Click on close. Your database has been migrated.
- Check on your Azure Portal to check the migrated database.
How to publish localdb to Azure from Visual Studio 2017
Do you have a Azure SQL Database created where you would be publishing the DB. You can follow this article to publish the DB
How to publish a website with sql local db database to azure using visual studio 2013
Try this http://www.asp.net/mvc/overview/getting-started/database-first-development/publish-to-azure and let us know if you need more help. You will just need Visual Studio 2013.
How to connect to LocalDB in Visual Studio Server Explorer?
OK, answering to my own question.
Steps to connect LocalDB to Visual Studio Server Explorer
- Open command prompt
- Run
SqlLocalDB.exe start v11.0
- Run
SqlLocalDB.exe info v11.0
- Copy the Instance pipe name that starts with np:\...
- In Visual Studio select TOOLS > Connect to Database...
- For Server Name enter
(localdb)\v11.0
. If it didn't work, use the Instance pipe name that you copied earlier. You can also use this to connect with SQL Management Studio. - Select the database on next dropdown list
- Click OK
Using a LocalDb MDF file on Azure
You can't use an .mdf file in App_Data, but you aren't forced to SQL Azure -- you can use SQL Server Compact. Deployment from LocalDB to Compact is easy if you are using Code First Migrations; otherwise you will have to migrate to SQL Server Compact before you deploy. If you decide to go with Compact you'll have to make sure the database engine gets deployed, and you can find instructions for that in this tutorial:
http://www.asp.net/mvc/tutorials/deployment/deployment-to-a-hosting-provider/deployment-to-a-hosting-provider-deploying-sql-server-compact-databases-2-of-12
Related Topics
How to Cancel a SQL Server Execution Process Programmatically
How to Make a Stored Procedure Return a "Dataset" Using a Parameter I Pass
Correct Way to Take a Exclusive Lock
Oracle Pl/SQL Results into One String
Can Scalar Functions Be Applied Before Filtering When Executing a SQL Statement
Does SQL Server Optimize Dateadd Calculation in Select Query
Difference Between a Inline Function and a View
How to Prevent Ssis from Writing Column Names to the Flat File Output
SQL Script to Change All Table References in All Stored Procedures
How to Use a Function-Based Index on a Column That Contains Nulls in Oracle 10+
Do Clustered Index on a Column Guarantees Returning Sorted Rows According to That Column
SQL Server Concatenate Group By
SQL Server:Find Duplicates in a Table Based on Values in a Single Column
How to Compare If Two Strings Contain the Same Words in T-SQL for SQL Server 2008