Why is query NOT using my index?

CREATE TABLE [LB].[Orders] ( [OrderID] [bigint] IDENTITY(1,1) NOT NULL, [OrderDate] [date] NOT NULL, [Status] [nvarchar](max) NULL, CONSTRAINT [PK_MasterOrderID] PRIMARY KEY CLUSTERED ([OrderID] ASC) ) CREATE NONCLUSTERED INDEX [PK_Index] ON [BTP_NYA].[LB].[Orders] ([OrderDate]); CREATE UNIQUE NONCLUSTERED INDEX [IX_OrderID_OrderDate] ON [BTP_NYA].[LB].[Orders] ([OrderDate],[OrderID]); I am trying to speed up this query: SELECT * FROM [BTP_NYA].[XX].[Orders] WHERE [OrderDate] = ‘20170921’ … Read more

ASP.NET Core 3.0 – Can’t Update-Database

I just created the project using the command dotnet new angular -o <output_directory_name> -au Individual and scaffold identity then I installed Microsoft.EntityFrameworkCore.SqlServer but when I run the command update-database, I get the error below. Failed executing DbCommand (4ms) [Parameters=[], CommandType=’Text’, CommandTimeout=’30’] CREATE TABLE [AspNetRoles] ( [Id] TEXT NOT NULL, [Name] TEXT(256) NULL, [NormalizedName] TEXT(256) NULL, … Read more

How to find out which Service Pack is installed on SQL Server?

How can I find out which Service Pack is installed on my copy of SQL Server? Answer From TechNet: Determining which version and edition of SQL Server Database Engine is running — SQL Server 2000/2005 SELECT SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’) — SQL Server 6.5/7.0 SELECT @@VERSION AttributionSource : Link , Question Author : Stefan … Read more

Which database has the best support for replication

I have a fairly good feel for what MySQL replication can do. I’m wondering what other databases support replication, and how they compare to MySQL and others? Some questions I would have are: Is replication built in, or an add-on/plugin? How does the replication work (high-level)? MySQL provides statement-based replication (and row-based replication in 5.1). … Read more

SQL Server Profiler – watch for permission denied on objects?

I’m using SQL Profiler to watch some database activity, and I’m interested in watching “Permission Denied” for various objects in the database. There are about 50 different items in the “Security Audit” category, but none that seem to display “Permission denied” for an object. I can see Login Failed, and a few other failures, but … Read more

System.ArgumentException: Keyword not supported: ‘provider’

I have a working copy of asp.net mvc site locally. I just uploaded the whole site to my web hosting server. everything looks fine at first but when i login, i get the following error: System.ArgumentException: Keyword not supported: ‘provider’. [ArgumentException: Keyword not supported: ‘provider’.] System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) … Read more

Is it possible to create a global stored procedure at Sql server level

I created a query that takes a database backup at certain specified location. I want to use it as a stored procedure but this should act as a global stored procedure so that whenever this SP is called. Then database backup is taken. It uses DB_Name() to take database backup of owner database. Is it … Read more