azure-sql-database

Entity Framework Scaffold-DbContext Login failed for user

六月ゝ 毕业季﹏ 提交于 2019-12-04 08:20:51
问题 I am trying to build an API using Visual Studio 2017 and .NET Core 2 with Entity Framework Core. I am following the directions from This Link. I am on the section titled: Reverse engineer your model The command they give to run is as follows: Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models My database is an Azure SQL database so I am trying to run this command using the connection string

In SQL Azure how can I create a read only user

自闭症网瘾萝莉.ら 提交于 2019-12-04 07:44:00
问题 I would like to create an SQL Azure user and grant her read-only access on a handful of DBs, what script can I use to achieve this? 回答1: A pure TSQL script is super messy, SQL Azure disables the USE command, so you are stuck opening connections to each DB you need to give the user read access. This is the gist of the pattern. In Master DB: CREATE LOGIN reader WITH password='YourPWD'; -- grant public master access CREATE USER readerUser FROM LOGIN reader; In each target DB (requires a separate

How to Resize a SQL Azure Database

本小妞迷上赌 提交于 2019-12-04 06:39:34
How do I resize my SQL Azure Web Edition 5 GB database to a 1 GB database? I no longer need the extra capacity and do not want to be billed at the higher rate. I don't see anything in the Management Portal and a quick web search also turned up nothing. David Makogon I answered a similar question here . It should be as simple as running an ALTER DATABASE command: ALTER DATABASE MyDatabase MODIFY (EDITION='WEB', MAXSIZE=1GB) Just keep this in mind: As long as your usage is <= 1GB, you'll be billed at the 1GB rate. Billing is monthly but amortized daily. So you actually don't need to reduce your

SqlPackage not accepting fully qualified name of tables in sync trigger

旧街凉风 提交于 2019-12-04 06:18:19
问题 I am using SymmetricDS version 3.9.15 on Azure SQL for both master and slave databases. I am able to configure the tool correctly to synchronize the databases but while publishing the database project the SqlPackage command gives an error due to the fully qualified name(including catalog name & schema name) of the table and function in the following trigger. USE [STAGING_PROD_Copy] GO /****** Object: Trigger [dbo].[SYM_ON_D_FOR_TRGGRLL_1_PRMRYSTGNG_PRDS] Script Date: 08-11-2018 21:17:09 *****

Does SQL Azure automatically geo-replication automatically failover?

 ̄綄美尐妖づ 提交于 2019-12-04 05:06:19
We have a geo-replicated database in SQL Azure (Premium) and are wondering if we are pointing to the South Central US database that is the master, if that goes down do we have to manually change our connection strings in our code (C# .Net / Entity Framework 6) to point to the new database in say North US? We are looking for a way to have a single connection string and then Azure do the under the covers to now point to the new database if the master ever goes down. Is that possible? Update on method followed: so I read this that we have to manually go into a web.config file on a production

How to avoid data loss with EF Model First database schema upgrade?

二次信任 提交于 2019-12-04 04:54:30
This is a long question, but I would be very very thankful if I can get some good advice on this. In short, I’m looking for a good approach for version upgrade of MS SQL database schema that also demands data being moved from deleted tables into new tables. I think Stack Overflow is the most appropriate place for this question (not dba.stackexchange.com) because at its core, this is an issue for .NET developers using Entity Framework, and the database parts of this consists mostly of auto-generated sql scripts. Background A .NET application and SQL database is running in Azure (The application

Entity Framework “Invalid attempt to read when no data is present” with 'large' data on Azure

时光怂恿深爱的人放手 提交于 2019-12-04 04:20:38
I am using Entity Framework (v4.0) to connect to SQL Azure (I have the March SDK installed) and getting a InvalidOperationException when trying to query a table. The message of the exception is Invalid attempt to read when no data is present. and the stack trace clearly shows that this is failing internally in EF when it attempts to get the column header: at System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32 i) at System.Data.SqlClient.SqlDataReader.IsDBNull(Int32 i) at lambda_method(Closure , Shaper ) at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper

Why does Azure Database perform better with transactions

南楼画角 提交于 2019-12-04 03:43:40
We decided to use a micro-orm against an Azure Database. As our business only needs "inserts" and "selects", we decided to suppress all code-managed SqlTransaction (no concurrency issues on data). Then, we noticed that our instance of Azure Database responded very slowly. The " rpc completed " event occured in delays that are hundreds times the time needed to run a simple sql statement. Next, we benchmarked our code with EF6 and we saw that the server responded very quickly. As EF6 implements a built-in transaction, we decided to restore the SqlTransaction (ReadCommited) on the micro-orm and

Entity Framework Many-to-Many Clustered vs. Nonclustered Index

北战南征 提交于 2019-12-04 03:22:18
I designed an entity data model with two entities between which there exists a many to many relationship. When I auto-generate SQL code to generate the database for this model, it has generated a table (two columns) to keep track of this many-to-many association. However, this table has a PRIMARY KEY NONCLUSTERED on both columns. Since I want this to work on SQL Azure which doesn't like tables with only nonclustered indices, I was wondering whether there is a good way of telling the code generation to generate clustered indices? Thanks! I have another file called Model.indexes.sql that

How can i change sql azure server location

我怕爱的太早我们不能终老 提交于 2019-12-04 02:54:11
I would like to transfer my existing SQL Azure location to other one, but I think there is no functionality right now to do so on the management portal of Azure. I just googled it and found one link http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/e6c961cc-5eea-4f07-82c9-a8805d367b05 that says I need to use the data sync option in Azure's portal but I don't have that feature enabled in my Azure portal. Also if I do use that option, is there any charge for it? Finally, are there any other option that is possible for moving the SQL Azure location? Craig I think you can use new