20,417 questions with SQL Server-related tags

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

How to script views by a pattern

Hi, I'm wondering if there is a simple way to script views definitions by some pattern, e.g. views in a particular schema and named using 'ndb' in the name? Thanks in advance.

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.
181 questions
asked 2025-05-09T14:14:17.4433333+00:00
Naomi Nosonovsky 8,351 Reputation points
commented 2025-05-09T23:53:16.44+00:00
Michael Taylor 58,866 Reputation points
1 answer

Issue with SQL Server 2022 RTM GDR (KB5046861) Update - Error code (Install error - 0x851a0020)

Greetings, I need help with an issue I’ve been experiencing for the past month. Below is a short description of the problem: I regularly install Windows updates, and about a month ago I encountered an issue with installing the SQL Server update…

SQL Server Database Engine
asked 2025-05-09T11:47:12.7733333+00:00
Havaji69 0 Reputation points
answered 2025-05-09T20:42:52.01+00:00
Erland Sommarskog 120.4K Reputation points MVP Moderator
2 answers

Can a column name used as part of a CTE be used in the SELECT query that creates the CTE?

When converting a SQL script from SQL Anywhere to SQL Server, my code generated an error for the following CTE code sample; the error says that the column name used in the ROW_NUMBER function is invalid. Any suggestions on how to fix this would be…

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.
181 questions
asked 2025-05-09T13:15:11.4133333+00:00
Gil Robinson 0 Reputation points
answered 2025-05-09T20:39:36.6966667+00:00
Erland Sommarskog 120.4K Reputation points MVP Moderator
1 answer

How to Migrate SQL Server from One Tenant to Azure SQL VM with Minimum Downtime

we have a scenario where we have a sql server on 1 tenant that needs to be transitioned to Azure SQL Virtual Machine. Scenario: 1, Minimum down time migrate from 2016 SQL on windows 2019 to SQL 2022 on windows 2022 Integration services need to be…

SQL Server Database Engine
asked 2025-05-09T17:05:32.98+00:00
Perera, Priyantha 0 Reputation points
answered 2025-05-09T20:32:55.45+00:00
Erland Sommarskog 120.4K Reputation points MVP Moderator
1 answer

Query hang on single user database

We created a new 24 vcore SQL Azure instance and are getting hangs for 81 minutes with no timeouts on an update which previous took seconds. There is only one user and no blocking session SELECT s.login_name, DB_NAME(r.database_id) AS…

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.
181 questions
asked 2025-05-09T20:07:38.4233333+00:00
Matt Esterly 0 Reputation points
answered 2025-05-09T20:28:07.7+00:00
Erland Sommarskog 120.4K Reputation points MVP Moderator
4 answers

Does SQL 2019 support 4096 key length for TDE?

Greetings Doing a project where customer requirements for 4096 key length. So does SQL 2019 support 4096 key length for TDE. SS

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 2021-10-01T06:42:34.863+00:00
Sarbjit Singh Gill 1 Reputation point
answered 2025-05-09T20:21:34.5266667+00:00
Dan Thomas 0 Reputation points
2 answers One of the answers was accepted by the question author.

SSIS job fails when run as a scheduled job - access denied

I created a job to export 4 SQL 2019 tables to an Excel workbook using the Export Data task to create the SSIS package in SSMS. The process works fine in SSMS but when I run the created SSIS package in SQL Agent, it fails due to access denied. It seems…

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,687 questions
asked 2025-05-08T19:01:33.9333333+00:00
Michael Harris 0 Reputation points
answered 2025-05-09T17:24:54.9966667+00:00
Michael Harris 0 Reputation points
1 answer

Timeline for Release of NEXT GEN Feature for Managed Service in Azure

What is the timeline for the release of the NEXT GEN feature for managed service in Azure? It has been in testing since March 2024. When will it be out of preview mode for general use?

Azure SQL Database
Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
167 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 2025-01-07T15:40:00.9233333+00:00
Anonymous
commented 2025-05-09T17:02:45.5+00:00
Mahesh Kurva 3,830 Reputation points Microsoft External Staff Moderator
1 answer

Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

Suddenly getting this error when using SSMS Import/Export Wizard and importing from Excel spreadsheet.

SQL Server Database Engine
asked 2025-05-07T19:08:52.1+00:00
Guy Petty 0 Reputation points
edited a comment 2025-05-09T14:24:27.86+00:00
Yitzhak Khabinsky 26,491 Reputation points
3 answers One of the answers was accepted by the question author.

Cannot insert Bassa Vah characters into SQL Server database

I am using SQL Server and Visual Studio 2022 for a language database, but I am unable to insert characters from this page for the Bassa Vah script (https://scriptsource.org/cms/scripts/page.php?item_id=character_list&key=16AD0). I tried NVARCHAR…

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.
181 questions
asked 2025-05-08T02:15:30.54+00:00
Dukaw LiberiaInfo 20 Reputation points
commented 2025-05-09T09:31:54.4133333+00:00
Erland Sommarskog 120.4K Reputation points MVP Moderator
2 answers

Getting a Table Column value in Catch section while using Output clause for Update Statement

Hi Team, I am working on a SQL Server Stored Procedure which uses Output clause for Update Statement. Table getting updated is having a column name as ID. I need to put Try Catch in this SP and make sure that row which has errored, I am able to get the…

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.
181 questions
asked 2025-05-08T18:13:11.07+00:00
Salil Singh 60 Reputation points
edited an answer 2025-05-09T07:48:14.54+00:00
Naveen Kumar M 175 Reputation points
2 answers

How to recreate sql from read transaction logs

How to read the transaction log to re-create an insert statement

SQL Server Database Engine
asked 2025-05-08T13:14:08.5333333+00:00
Jensen, Randy 0 Reputation points
commented 2025-05-09T05:53:12.9866667+00:00
博雄 胡 585 Reputation points
1 answer

When tried to export my database that is in SQL database to bacpac got the errorFailed to export the database: nexxus-oltp-prod. ErrorCode: undefined ErrorMessage: The Export operation failed because database is larger than max supported size.

When tried to export my database that is in SQL database to bacpac got the errorFailed to export the database: nexxus-oltp-prod. ErrorCode: undefined ErrorMessage: The Export operation failed because database is larger than max supported size.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,687 questions
asked 2025-05-08T02:40:39.0266667+00:00
Sripathi Eravelly 0 Reputation points
answered 2025-05-08T19:35:22.57+00:00
Bruce (SqlWork.com) 75,306 Reputation points Moderator
1 answer One of the answers was accepted by the question author.

Query related to length in CAST and Output clause

Hi Team, Could you please reply to below queries - Using CAST, I need to convert BigInt and Datetime2 values to Varchar. How could I be sure on the length that I need to use (in CAST) to convert these values to Varchar. I am using Update statement…

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.
181 questions
asked 2025-04-22T18:21:46.98+00:00
Salil Singh 60 Reputation points
accepted 2025-05-08T17:49:10.58+00:00
Salil Singh 60 Reputation points
1 answer

Trigger on cascading update target doesn't fire when the OUTPUT clause is used

Hello. I asked this question on stackexchange and the guys from the community recommended me report it to Microsoft https://dba.stackexchange.com/questions/346386/trigger-on-cascading-update-target-doesnt-fire-when-the-output-clause-is-used Below is the…

SQL Server Database Engine
asked 2025-05-05T09:50:45.2+00:00
Igor Telegin 0 Reputation points
commented 2025-05-08T16:21:05.5733333+00:00
Igor Telegin 0 Reputation points
1 answer

Copying all tables from one Azure Managed Instance database to another

What is the best method to copy all tables from DatabaseA to DatabaseB in an Azure Managed Instance, including all object-level permissions, triggers, views, and indexes? The Export/Import and SELECT * INTO methods are known not to retain object-level…

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.
181 questions
asked 2025-04-28T00:09:58.4133333+00:00
Vijay Kumar 2,036 Reputation points
answered 2025-05-08T15:32:57.71+00:00
Naveen Kumar M 175 Reputation points
1 answer

Investigate Root Cause of DBCC CHECKDB error | (SQLSTATE 42000)(Error 8992 | Catalog Msg 3853)

Details: I am running Microsoft SQL Server 2022 I am running DBCC CHECKDB on a user database (of which raised this error), each saturday This has happened on one on-prem Windows Server with installation of SQL server, with a predefined set of…

SQL Server Database Engine
asked 2025-05-07T08:39:20.11+00:00
Lucas Bjorndal 0 Reputation points
answered 2025-05-08T07:22:23.6533333+00:00
Lucas Bjorndal 0 Reputation points
1 answer

Unable to upgrade SSISDB -Doesn't match the version of upgrade tool

Hi All, I am trying upgrade SSISDB in SQL 2022 , The SSISDB backup I have copied from SQL 2014. While running ISDBUpgradeWizard I am getting below error. "TITLE: SQL Server Integration Services The version of the sql server instance (16.0.4175.1)…

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,687 questions
asked 2025-05-07T16:11:08.3133333+00:00
Ambily Jose 25 Reputation points
answered 2025-05-08T06:01:41.71+00:00
Olaf Helper 46,641 Reputation points
0 answers

Cyber Attack or Account Compromized

Hi, Someone deleted my SQL Database instance name 'CroLahoreDB' early today 08:33 am, I want to know that how is it possible either it is cyber attack or my Account is compromized or some virus? How can I check it? please guide me. Regards Mubashir Ali

SQL Server Database Engine
asked 2025-05-07T10:59:26.3033333+00:00
Mubashir Ali 0 Reputation points
commented 2025-05-07T21:03:11.0666667+00:00
Erland Sommarskog 120.4K Reputation points MVP Moderator
0 answers

SQL Stretch DB - error Msg 40673, Level 16, State 1, Line 24

Hi when setting up StrechDB from an on prem server i get the error below Msg 40673, Level 16, State 1, Line 24 The service objective assignment for the database has failed This happens when i run the following script ALTER DATABASE XXXXXXX SET…

SQL Server Database Engine
asked 2025-05-07T17:36:13.0966667+00:00
Arthur Moulding 0 Reputation points
commented 2025-05-07T20:52:46.9233333+00:00
Erland Sommarskog 120.4K Reputation points MVP Moderator