20,268 questions with SQL Server-related tags

Sort by: Updated
2 answers One of the answers was accepted by the question author.

Changing Primary Keys for Existing Tables Containing Data

Hi, Running SQL Server 2008 R2 SP3. We are working on implementing some DDL changes with the goal of improving overall performance. Aside from indexing strategies we would like to change the data type of primary key columns from varchar to bigint. …

SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
163 questions
asked Mar 22, 2025, 4:05 AM
VDT-7677 161 Reputation points
commented Apr 6, 2025, 12:06 AM
Erland Sommarskog 120.2K Reputation points MVP
2 answers

Using OPENROWSET to Export to .csv Not Inserting Rows

When I execute the code below in SSMS I receive the message X rows affected where X is the number of rows in mytable. When I open myfile.csv it remains empty except for the headers which were in the file prior to me executing the INSERT. Is there some…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,697 questions
asked Jan 5, 2022, 7:43 PM
David Kingston 21 Reputation points
commented Apr 5, 2025, 6:38 PM
Bruce (SqlWork.com) 73,661 Reputation points
0 answers

Unexpected Plan Regression in SQL Server 2022 CU10 After Query Store Forced Plan Enabled

Hello After upgrading to SQL Server 2022 CU10, we noticed a sudden performance regression on a stored procedure that previously ran fine. We had Query Store enabled with a forced plan applied for stability & it was respected correctly until this…

SQL Server Database Engine
asked Apr 5, 2025, 6:54 AM
catherinebennett 0 Reputation points
0 answers

How to fix MS SQL Server Express 2019 startup error?

Hi guys. I'm trying to install MS SQL Server Express 2019 on Windows 11. I did end up installing MS SQL Server Express 2019 and verified my installation using "where sqllocaldb" on Windows Cmd. However, I get error when I try "sqllocaldb…

SQL Server Database Engine
asked Apr 5, 2025, 6:35 AM
SH Bae 0 Reputation points
0 answers

SQL Installer

I downloaded the free software and I'm attempting to use SQL, but I'm getting an error message when trying to install it. Any solutions?

SQL Server Training
SQL Server Training
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Training: Instruction to develop new skills.
16 questions
asked Apr 4, 2025, 9:00 PM
Charles Allen 0 Reputation points
commented Apr 4, 2025, 9:01 PM
Michael Taylor 57,796 Reputation points
2 answers

How to create a localDB

Dear all, once upon a time, I had good experiences with SQL Server. I was able to create a localDB out of the Management Studio. Nowadays it seems this not possible any longer. A colleague of mine gave me the following learning…

SQL Server Database Engine
asked Apr 3, 2025, 2:58 PM
Daniel 0 Reputation points
answered Apr 4, 2025, 6:27 PM
Vaishnavi Mishra 0 Reputation points
1 answer

SQL Server 2019 replace() function does NOT replace char(30) with empty string properly

I ran across a funny bug in SQLserver 2019, when trying to replace char(30) (ascii character 30) in a string, with an empty string (effectively removing the char30 from the string), the replace() function also strips all trailing spaces in the string.…

SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
163 questions
asked Apr 4, 2025, 5:43 PM
Benjamin Nunes 0 Reputation points
edited an answer Apr 4, 2025, 6:05 PM
Viorel 121K Reputation points
0 answers

A mistake in a training module

Module: Configure database authentication and authorization Unit: Describe security principal Seems like there is a mistake for equivalent of database roles: loginmanager and dbmanager and their equivalent on on-prem should be switched This question is…

SQL Server Training
SQL Server Training
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Training: Instruction to develop new skills.
16 questions
asked Apr 4, 2025, 1:30 PM
Farhang Nosratmakuee 0 Reputation points
2 answers

Login failed for user [domain\computer name] reason could not find a login matching the name provided. [client <local machine>]

Hi, I know this is an old issue, but I have looked everywhere and still I'm stuck with this. I have a local instance of SQL 2022, (16.0.1135.2), in my development computer. The computer is on a domain and I'm able to login with Windows Authentication. I…

SQL Server Database Engine
asked Apr 3, 2025, 6:42 PM
Luis 156 Reputation points
answered Apr 4, 2025, 12:07 PM
Luis 156 Reputation points
0 answers

SQL on Always ON HA is on Suspect mode

We have one database in suspect status and one database in Initializing/in recovery. The application is Solarwinds and it fails to start unless the databases are in sync Anyone face that issue ?

SQL Server Database Engine
asked Apr 4, 2025, 11:41 AM
Solonas Andreou 75 Reputation points
2 answers

Can only select both tables filter direction in SSAS tabular

Hi, I use the same SQL server database to do an import in Power BI Desktop as for my model created in SSAS Tabular SQL Server 2019 with Visual Studio 2019. My issue is in the create relationships. In Power BI Desktop I can do: In Visual Studio I…

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,332 questions
asked May 16, 2023, 2:16 PM
Arjan Fraaij 0 Reputation points
commented Apr 4, 2025, 9:06 AM
BHARDWAJ Bhavya 0 Reputation points
2 answers One of the answers was accepted by the question author.

Adding Conditional Not Null Constraint to Table

Hi, Running SQL Server 2008 R2. DDL below: CREATE TABLE [dbo].[Test] ( [TestID] [bigint] NOT NULL IDENTITY, [Column1] [varchar](50) NOT NULL, [Column2] [varchar](50) NULL, [Column3] [varchar](50) NULL, [Flag] [bit] NOT NULL, CONSTRAINT…

SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
163 questions
asked Mar 25, 2025, 8:47 PM
VDT-7677 161 Reputation points
accepted Apr 4, 2025, 3:02 AM
VDT-7677 161 Reputation points
0 answers

Shrinking Production Database Post-Transition

Hi, Running SQL Server 2008 R2. We are in the process of planning a change to a database to use integer-based primary keys instead of character-based primary keys. The update process works in our test environment, but as a result we end up with a…

SQL Server Database Engine
asked Apr 4, 2025, 3:02 AM
VDT-7677 161 Reputation points
5 answers

How to install SQL Server 2022 on Ubuntu Server 24.04 LTS

I couldn't find a proper way to install SQL Server 2022 on Ubuntu Server 24.04 LTS. I tried to use Microsoft SQL Server 2022 from the Ubuntu 22.04 repository, but I couldn't run the service correctly. I'm done with this state of service (see printout).Is…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
asked Jun 9, 2024, 10:09 PM
Eghost 0 Reputation points
commented Apr 4, 2025, 1:57 AM
Mohamed Alla Pitchai 0 Reputation points
1 answer

[SQL Server 2019 Standard]Order history now shows, but missing download link and product key

Hello, I am currently having trouble downloading SQL Server 2019 Standard that I purchased from the Microsoft Store(https://www.microsoft.com/). The purchased item is certainly displayed in my order history, but I cannot find the download link or product…

SQL Server Database Engine
asked Mar 18, 2025, 10:59 AM
kataoka 0 Reputation points
edited the question Apr 4, 2025, 1:42 AM
kataoka 0 Reputation points
0 answers

SQL server lift and shifted to Azure is using 100% cpu

HI, SQL server lift and shifted to Azure is using 100% cpu. when I check activity monitor everyday different SQL select statement is using the high CPU. sometimes it is as simple as select get date(). Please let know how can I find what is causing the…

SQL Server Database Engine
asked Apr 4, 2025, 12:23 AM
Newtojob 66 Reputation points
0 answers

SQL Server Setup Error 2147467259 - The system cannot find the path specified

Hello, I am trying to install SQL Server 2022 on my Windows 10 Pro system using the EXE installer. I chose to install it on Drive D: as an adminstrator but the setup fails with the following error: Unable to install SQL Server (setup.exe) Exit code…

SQL Server Database Engine
asked Apr 3, 2025, 8:36 PM
Kingsley Gyan 0 Reputation points
edited the question Apr 3, 2025, 8:44 PM
Kingsley Gyan 0 Reputation points
2 answers

SQL Server 2022 CU18 Crashing with EXCEPTION_ACCESS_VIOLATION

SQL Server 2022 CU18 is experiencing crashes approximately 1-2 times a month since installation. The error log shows the following message: 2025-03-18 08:20:04.77 spid70 SqlDumpExceptionHandler: Process 70 generated fatal exception c0000005…

SQL Server Database Engine
asked Mar 18, 2025, 11:00 PM
Anonymous
edited an answer Apr 3, 2025, 4:55 PM
Olivier Castonguay 0 Reputation points
1 answer

Add-Migration works, but Update-Database says "no migrations to update". I tried deleting the Mig.. Folder

Visual Studio and EF Core problem. Migrations don't work. Add-Migration Title works to update the schema, but Update-Database in NuGet Command Console says that the db is already up to date, but the db does not have my new table in it. I tried…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
779 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
asked Dec 31, 2023, 1:49 AM
John Murphy 30 Reputation points
commented Apr 3, 2025, 3:55 PM
Chris Fox 0 Reputation points
2 answers

I have been trying to install SQL Server 2022 Developer edition on windows 11, still so far no success

Detail.txt Hi, i have trouble installing SQL server on windows 11. did mentioned steps as well to troubleshoot, still no success. …

SQL Server Database Engine
asked Apr 1, 2025, 2:57 AM
Raja sekhar Ogirala 0 Reputation points
commented Apr 3, 2025, 3:53 PM
Raja sekhar Ogirala 0 Reputation points