Recent Discussions
Bug: "Invalid column name" after sp_recompile for valid column in custom data type
Hello, I was hoping to find a workaround for an issue I am having. I believe this is a bug in SQL Server (we are using SQL Server 2022) I have written a utility stored procedure for solving the gaps and islands problem, utility.GetTimeIslands, which returns the longest contiguous islands from the time islands passed into it. This procedure utilizes a custom datatype, utility.TimeIslandList, which is defined as CREATE TYPE utility.TimeIslandList AS TABLE ( ISLAND_ID BIGINT NOT NULL, KEY_1 BIGINT NOT NULL, KEY_2 BIGINT NOT NULL, KEY_3 BIGINT NOT NULL, START_DATE DATE NOT NULL, END_DATE DATE NOT NULL, PRIMARY KEY (ISLAND_ID) ); The call to utility.GetTimeIslands in PRC.LoadDeals is DECLARE Til utility.TimeIslandList; INSERT INTO Til SELECT STG_DEAL_SCHEDULE_ID, DEAL_ID, PRICE_ACCOUNT_SET_ID, PRICE_ITEM_ID, START_DATE, END_DATE FROM #DealSchedulePrep; INSERT #LatestTimeIslands EXEC utility.GetTimeIslands Til; If PRC.LoadDeals is called after a server reboot, or after EXEC sp_recompile 'utility.GetTimeIslands'; Is called, it throws the error "Msg 207, Level 16, State 1, Procedure utility.GetTimeIslands, Line 60 [Batch Start Line 8] Invalid column name 'KEY_3'." Line 60 corresponds to the first statement in utility.GetTimeIslands where the custom data type is referenced WITH ChangePoints AS ( SELECT KEY_1, KEY_2, KEY_3, START_DATE as X_DATE FROM Til UNION SELECT KEY_1, KEY_2, KEY_3, DATEADD(DD, CASE END_DATE WHEN '9999-12-31' THEN 0 ELSE 1 END, END_DATE) FROM Til ) ... However, if DECLARE Til utility.TimeIslandList; EXEC utility.GetTimeIslands Til; Is called prior to calling PRC.LoadDeals, then PRC.LoadDeals does not throw the error. And PRC.LoadDeals will execute successfully until utility.GetTimeIslands is recompiled. Another interesting twist is that adding those lines to PRC.LoadDeals, prior to the actual call, does not help. It throws the same error on the empty call, if the empty call is made inside the stored procedure before the empty call is made outside the stored procedure. For that matter, once any call is made to utility.GetTimeIslands outside the stored procedure, calls made to it inside the stored procedure will work. Has anyone ever seen anything like this? If so, is there a solution outside of making the GetTimeIslands empty call after each server restart? Does anyone have a guess as to why the error message calls out KEY_3 specifically?58Views0likes1CommentSolved : Uneven CPU usage
Greetings and salutations, I'm asking for your help with a situation that I'm not sure is a real problem, but it definitely caught my attention. We bought new hypervisor servers with two AMD EPYC 9174F processors (16 cores, 4.1 GHz, so 32 cores in total ). We are using Hyper-V. The hypervisor hosts only a single VM assigned 16 virtual cores. The VM is running Windows Server 2022 Standard and SQL Server 2019 Standard CU27. The VM was moved to this AMD hypervisor from another hypervisor, which was equipped with two Intel Xeon Gold 6346 processors (16 cores, 3.1 GHz, 32 cores in total). When monitoring the resource usage of a VM that is now running on the new AMD hypervisor, I see very uneven CPU usage that was not the case on the previous Intel hypervisor. As you can see in the images from Task Manager and Perfmon, the first 8 cores are significantly more loaded against the other 8. While the core for example core 0 and 1 are on average loaded at 66%, cores 14 and 15 are loaded at 2-4%. The SQL Server ERRORLOG clearly states that all 16 cores are in use, which is confirmed by querying the sys.dm_os_schedulers object. I'm partially hoping this is a Perfmon-level issue, but I certainly don't want to underestimate the situation. Perhaps I should direct my question to the Windows forum, but since it is database system, I'm creating a thread here. Does anyone have any idea how I should go about solving this situation please? Solution Almost by accident I managed to solve the problem and I'm ashamed that I didn't solve the problem sooner. The cause of the problem was an inappropriately set Widnows Server Power Plan. As you probably know, the default setting after installation is the Balanced mode, which, however, is extremely unsuitable for performance-intensive applications, which are database systems. Out of 16 virtual cores, 8 were in "Parked" mode. Changing the configuration to "High Performance" solved the problem immediately. It's already my routine to change this configuration when setting up each database server, and I'm almost certain I've done it on this system as well.839Views1like3CommentsSQL 2025 Jobs
SQL Server 2022 16.0.4212.1 Installed in a windows server 2025 DC. SQLSERVERAGENT starts with NT Service\SQLSERVERAGENT I have some jobs that runs at the scheduled times. But one no. Failure: "Job failed. The job was invoked by Schedule 9 (06:00 xxxxx). The last step to execute was step 0 (no steps ran)." Job steps: exec SP_01 GO EXEC SP_02 But if I run it manually, it runs without problems. Can anyone help me? Thank you88Views0likes4CommentsSQL SERVER EXPRESS EDITION 2022 NOT INSTALLING ON MY SNAPDRAGON X PROCESSOR
Every time i try to install sql server on my laptop ASUS ASUS Vivobook S16 (2025) with Office 2024 + M365 Basic*, Metal Body*, Qualcomm Snapdragon X - (16 GB/512 GB SSD/Windows 11 Home) S3607QA-SH075WS Thin and Light Laptop (16 inch, Cool Silver, 1.74 Kg, With MS Office) I get this error: Error installing SQL Server Database Engine Services Shared Features There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Error code: 1722 Log file: C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\Log\20250811_013441\sql_engine_core_shared_Cpu64_1.log Attaching the error ss Let me know what should I do177Views0likes7CommentsDo input tag values keep updating after SP execution begins?
In my facility we use PLC's to trigger SQL Stored Procedures through a Kepware server. Most of these SP's are for data collection. If I set the execute bit to true, but then one of my data collection points changes value before the execution finishes, does the SP see that data change? Or is it just using the value as it was at time of execution start? Thanks for your help in advance15Views0likes0CommentsSQL Server 2019 – Repeated Recovery Mode and Backup Failure After Server Shutdown
Hello, We are currently using SQL Server 2019 Standard Edition in our company. Recently, our server experienced a complete shutdown due to a lightning strike. After the incident, one of our databases entered Recovery Mode, and it took approximately one hour before it returned to normal operation. The issue is that this behavior repeats every time we restart SQL Server. In other words: Server restart → Database enters Recovery Mode → Returns to normal after about one hour. Additionally, we are unable to perform backups on this database. Based on the SQL Server error logs and Windows Event Viewer, it appears that the backup attempts fail because the database has not completed recovery at the time of execution. We would like to ask for guidance on the following points: Could this issue be related to physical damage or disk corruption? Is there a way to prevent the database from entering Recovery Mode, or at least speed up the recovery process? Besides running DBCC CHECKDB, are there any other diagnostics or recovery strategies we should consider? Additional Information: SQL Server 2019 Standard Edition (on-premises) The affected database is running on a single instance We attempted to copy only the MDF file to another server and recover the database, but this also failed Thank you in advance for your support.100Views0likes3CommentsSQL Server Manager Studio V21 failed to install Configuration Manager
I installed SQL Server Management Studio V21 specifically: Step 2 - Determine which version of SQL Server Management Studio to install Decide which version of SSMS to install. The most common options are: The latest release of SQL Server Management Studio 21 that is hosted on Microsoft servers. To install this version, select the following link. The installer downloads a small bootstrapper to your Downloads folder. It downloaded a file: vs_SSMS.exe which I clicked on and "run as Administrator". FYI: It used the Visual Studio installer which I do NOT like since I was not able to follow the progress of the installation. After the installation completed I tried to connect as "sa" with my password and got this message: See SQL Server V21 error.png SQL Server is installed locally on my laptop, not on a network. I want to change to use TCPIP protocol for my connections. Also, when I looked at "Services" I did NOT find a service for Microsoft SQL Server. Any assistance would be appreciated. Thanks MurraySolved346Views1like6CommentsSQL Server 2022 Express Install Issues
I am a non tech savvy student trying to install SQL Server 2022 Express for class and I am running into issues, looking for help. It gets all the way through the install process and gives me "Unable to install SQL Server (setup.exe) Exit code (Decimal): -2061893606Error description: Wait in the Database Engine recovery handle Failed. Check the SQL Server error log for potential causes" and C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\Log\20250903_162628 I have fully uninstalled anything related to SQL and reinstalled multiple times with no success. I reset windows, no luck. Any help would be appreciated.57Views0likes1CommentSQL Server not supported Windows 11 Home Version
I bought a new computer that came with Windows 11 Home. I am unable to install SQL Server 22 on W11. I would like to install Windows 10 that does support SQL server but I will void my support warranty doing so. I suspect I can upgrade to Windows 11 Pro but I am not sure that OS supports SQL Server. Any thoughts or advice would be helpful.1.5KViews0likes7CommentsAvailability Group failover issue
Hello, We ran into an issue recently that caused a three-node availability group to fail. We're running SQL Server 2019 (RTM-CU32-GDR) on Windows Server 2019 Standard (version 1809). We're trying to understand why the availability group wasn't able to start when the cluster automatically failed it over to another node. First, here is the state/configuration of the availability group just before the failure: Node A - primary replica; synchronization state = synchronized; availability mode = synchronous commit; failover mode = automatic Node B - secondary replica; synchronization state = synchronized; availability mode = synchronous commit; failover mode = automatic Node C - secondary replica; synchronization state = synchronized; availability mode = synchronous commit; failover mode = manual Here's the abbreviated summary of events: An I/O error occurred on node A. Specifically, it was a checksum mismatch when reading one of the tempdb files. This caused the availability group cluster resource to fail. The cluster tried unsuccessfully to restart the AG on node A so it failed over the AG to node B. The AG failed to come online on node B. The cluster failed back the AG to node A and left it in a failed state. We manually failed over the AG to node B a few minutes later and it was successful. When the cluster tried to automatically fail over the AG to node B, the only error we found that indicates why the AG couldn't start is: "SQL Server Availability Group <AG1>: [hadrag] ODBC Error: [42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]The availability replica for availability group 'AG1' on this instance of SQL Server cannot become the primary replica. One or more databases are not synchronized or have not joined the availability group. If the availability replica uses the asynchronous-commit mode, consider performing a forced manual failover (with possible data loss). Otherwise, once all local secondary databases are joined and synchronized, you can perform a planned manual failover to this secondary replica (without data loss)." Since all nodes were in synchronous commit mode, the above error implies that the secondary databases on node B were either not joined or not synchronized. This is concerning and we're worried that auto-failover is not as reliable as we expected. Does anyone have any suggestions for how to ensure the secondary node is ready and able to become primary when the AG fails on the original primary node? Or any suggestions for settings/configuration to change? The only corrective action we have taken so far is to increase the "maximum failures in the specified period" from the default of 2 to 6 (per the recommendation https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/hadr-cluster-best-practices?view=azuresql&tabs=windows2012#relaxed-monitoring) and to decrease the failover period from the default of 6 hours to 2. Any suggestions or insights would be greatly appreciated.149Views0likes6CommentsFail to OPENROWSET insert geometry data from parquet
Hi! I'm trying to insert geometry data (WKB) from a parquet file to a data base table. I manage to get it working for small geometries but it's failing for lager geometriers. Here is the code: INSERT db.s.t SELECT geometry::STGeomFromWKB(a.geom,1) FROM OPENROWSET ( BULK 'path_to.parquet', FORMAT = 'PARQUET', DATA_SOURCE = 's3_sorce' ) AS a The failure: String or binary data would be truncated while reading column of type 'VARBINARY(8000)'. Check ANSI_WARNINGS option.... Seems as if the geometry type is not recognized. Is there a way around this?28Views0likes0CommentsHow to resolve issue of custom Audit log table containing incorrect data?
We have created a parent table, child table & Audit log table in SQL Server database. For one parent record, there are multiple child records. When a child record in updated, a Stored Procedure is called in which a few fields of all the child records are updated that are associated with the parent record. We have 'for insert/for update' triggers created on the child table in SQL Server which inserts the new/updated child record into a custom Audit log table. The 'for update' trigger for the child table uses mapping based on the parent record id for inserted & deleted pseudo tables. This 'for update' trigger adds into Audit log table any changes done to the child record fields except the few fields that are updated using the Stored Procedure. We have noticed a pattern in the Audit log table which reoccurs again & again only in Production env. We are unable to reproduce this issue in Non-Production envs. After about 25 to 30 correct child records for several parent records are added in the Audit log table that the user had updated in the child table, several old child records for a parent record also get added into the Audit log table which were not updated in the child table by the user. Please let us know what is the root cause & resolution of this issue.49Views0likes1CommentIntegration Services service "Computer Name" failed with error: "Class not registered"
Hi All, See below error when trying to login to intergration service. Does anyone know how to resolve? Connecting to the Integration Services service on the computer "Computer Name" failed with the following error: "Class not registered". This error can occur when you try to connect to a SQL Server 2005 Integration Services service from the current version of the SQL Server tools. Instead, add folders to the service configuration file to let the local Integration Services service manage packages on the SQL Server 2005 instance. Regards75Views0likes3CommentsNeed help with SQL error 26
Hi All, I need help with SQL server error 26, I have a desktop application that runs on Windows Server and the app could be open on some servers and not others, attached image is the error that I get and I confirmed there is no firewall block as I could ping the SQL server and also remote desktop into it, can anyone advise me on this, thanks.115Views0likes2CommentsTo call a VBA script from a T-SQL procedure
I have the following (unusual) task: I need my T-SQL procedure to somehow call a VBA script. The VBA should copy all content of a certain sheet of an input Excel file into a certain sheet of an output Excel file. The physical full path of the input Excel file is available only in the T-SQL procedure. Therefore, the procedure should somehow pass the file path into the VBA script. How can I do that?50Views0likes1Commentadding computed column to MS SQL
would like to check how to add a computed column with the following requirement Column value will be C-yyyyMMdd-0001 where date will be from the CreatedDate column in the same table. 0001 is an auto-incremental value based on when the record is inserted on the same day eg, the first record added on 23/08/2025, the computed column will be C-20250823-0001. As the table may already contain existing data, a SQL script may also be necessary to update this new column with the correct value.88Views0likes3CommentsSQL Server 2017 – CLR was loaded in an unsupported manner (All SSIS jobs failed)
Hi, We are facing a critical issue in our SQL Server 2017 instance. When trying to use a built-in CLR function or running SSIS-related jobs, we are getting the below error: The Common Language Runtime (CLR) was loaded in an unsupported manner. This can occur if an extended stored procedure or OLE Automation object running in SQL Server calls into managed code before the CLR integration runtime host loads the CLR. You need to restart SQL Server to use CLR integration features. Steps tried so far: Restarted SQL Server service Restarted the entire Windows Server Verified .NET Framework version (4.7.03062 installed) Confirmed CLR integration is enabled (sp_configure 'clr enabled', 1) All SSIS jobs are failing due to this issue. Any suggestions, please?51Views0likes0CommentsSQL server 2016 with Integration services on Ubuntu
Hi everyone, I need to setup SQL server 2016 on Ubuntu with Integration Services. Is it feasible to install SSIS with SQL server 2016 on Ubuntu for Prod use? If i go to Microsoft documentation,they only showing SQL 2017 and 2019 for Linux. Can anyone help with any related resources for clarification w.r.t SQL 2016? Thanks in advance Prakash925Views1like2Comments
Events
Recent Blogs
- We’re happy to announce that SQL Server 2025 Release Candidate 1 (RC1) now includes preview support for Red Hat Enterprise Linux (RHEL) 10, expanding our commitment to modern, secure, and flexible Li...Sep 17, 2025292Views1like0Comments
- English follows Japanese. こんにちは、 SQL Server サポート チームです。 今回は、SQL IaaS Agent 拡張機能と Azure 上の SQL 仮想マシン リソースについて解説します。 SQL Server IaaS Agent 拡張機能とは SQL Server IaaS Agent 拡張機能は、Azure Porta...Sep 17, 202583Views2likes0Comments