Recent Discussions
REPL55012 error
hello. i tryin make db replication(publisher - mssqlserver2019standard, subscriber - mssqlserver 2019 express). at step when "magic should make things" i got error: Get help: https://help/MSSQL_REPL55012 it so strange" in sql forums MS forbidden post exact error message. any directions where to dig? thanks. ps. i tryin reinnstall latest ole db drivers but no luck.21Views0likes1CommentSQL Version Upgrade 2017 to 2019 in an unclustered read-scale availability group
We need to upgrade our production SQL servers from SQL 2017 to 2019 (both are Ent. Edition). We have ~70 servers hosted in our DC. Each SQL Server instance consists of 2 VMs in a 2 node FCI, failing over at the beginning of and mid-month. They constitute the primary in a read-scale AG, utilized for offloading read heavy reporting. The secondary in the AG is a single server Iaas VMs hosted in Azure, 1 per FCI. The AGs are set to manual failover, asynchronous commit. The primary and secondary are not together in a WSFC. Because they are not bound in a WSFC we believe we should be able to update the secondary to SQL 2019, then perform a rolling upgrade on the 2 node primary, without first removing the secondary from the AG and afterward having to reseed the DBs in the AG. Each server hosts ~50 client DBs and we'd like to avoid having to reseed some 3000+ DBs. Most of what I've found online deals with clustererd AGs so any experience, advise, comment is most welcome.24Views0likes1CommentBug: "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?85Views0likes1CommentDo 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 advance19Views0likes0CommentsSQL 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 you112Views0likes4CommentsSQL 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.76Views0likes1CommentFail 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?29Views0likes0CommentsHow 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.55Views0likes1CommentSQL 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 do212Views0likes7CommentsAvailability 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.159Views0likes6CommentsSQL 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.111Views0likes3CommentsSQL 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?54Views0likes0CommentsTo 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?54Views0likes1CommentIntegration 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. Regards79Views0likes3Commentsadding 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.92Views0likes3CommentsAssistance with SQL Joins - or - using Nested/Subquery?
Relative noob to SSMS, however have had decent success in a few simple queries with 4-7 joins. In two separate queries i can capture two populations of data that apply to and link through a group of provider ID's. The two queries are as follows: 1. identify group of providers set to active status on or after a given approval date. 2. identify all plans and addresses linked to each provider Each of those function perfectly on their own, but i am struggling to pull the providers active approval date (Q1) (which is it's own column) into the output of Query 2, listing of all plans and addresses linked to that provider. In these scenarios it's important to note - A provider will have a single approval date, multiple addresses, and each address will be tied to 15-17 insurance plans - so a single to many to many relationship. Assignment_RTK is our systems key for 'Insurance Plan', Entity_K is key for which organization a provider is working for, and Provider_K is the provider key. Provider_K, Entity_K, and OriginalAppointmentDate all live in the EA (Entity Assignments) table. Plan keys in the form of Assignment_RTK live, somewhat confusingly in the EntityAssignment table as well, but adding either the provider approval date as a criteria to Query 2 will result in no returns (but also no errors), and adding the Plan Keys (Assignment_RTK) to the Approval date query will result in Null values in Assignment_RTK column. Copy of the queries below, and i've disguised tax id numbers for my organization. Query 1 - SELECT PR.LastName,PR.FirstName,PR.DisplayDegrees,PR.Npi,PR.Id,GR.GROUPNAME,EA.* FROM Visual_Cactus.visualcactus.EntityAssignments as EA Join Visual_Cactus.visualcactus.Providers as PR on EA.Provider_K = PR.Provider_K Join Visual_Cactus.visualcactus.PROVIDERADDRESSES as PA on PR.Provider_K = PA.PROVIDER_K Join Visual_Cactus.visualcactus.GROUPADDRESS as GA on PA.ADDRESS_K = GA.ADDRESS_K Join Visual_Cactus.visualcactus.GROUPS as GR on GA.GROUP_K = GR.GROUP_K WHERE EA.OriginalAppointmentDate >= DATEFROMPARTS(YEAR(GETDATE()),MONTH(GETDATE()),1) and EA.Entity_K like '%TCHN' and GA.TAXIDNUMBER in ('xxxxxxxxx','xxxxxxxxx','xxxxxxxxx','xxxxxxxxx','xxxxxxxxx','xxxxxxxxx','xxxxxxxxx','xxxxxxxxx','xxxxxxxxx','xxxxxxxxx',) Query 2 SELECT EAAD.*,GA.GROUP_K,PR.LongName,AD.AddressLine1,AD.AddressLine2,AD.City,AD.State,AD.ZipCode,EA.Assignment_RTK FROM Visual_Cactus.visualcactus.Addresses as AD Join Visual_Cactus.visualcactus.PROVIDERADDRESSES as PA on AD.Address_K = PA.ADDRESS_K Join Visual_Cactus.visualcactus.Providers as PR on PA.PROVIDER_K = PR.Provider_K Join Visual_Cactus.visualcactus.EAADDRESSES as EAAD on PA.PROVIDERADDRESS_K = EAAD.PROVIDERADDRESS_K Join Visual_Cactus.visualcactus.EntityAssignments as EA on EAAD.EA_K = EA.Ea_K Join Visual_Cactus.visualcactus.GROUPADDRESS as GA on AD.ADDRESS_K = GA.ADDRESS_K WHERE EAAD.ACTIVE = '1' and EA.Assignment_RTK in ('D2GT0MDZ4G', 'D2EK0KVTUN', 'D2ER0FKD24', 'D2ER0FJWWG', 'D2ER0FGOP7', 'D2ER0FG8HL','C4I80SMAER','P36Y0ZCIX4','D2ER0FFJ74','D2ER0FE95G','D2ER0FDEUF','D2ER0F9KQ0','D2ER0FA7YH','C4V60N6TTC','D2ER0F7FBI','D2ER0F6PN4','D2OE0KNTKW')722Views0likes1CommentProblem with differential backups, after a problem with a full backup
I have a database in Microsoft SQL server 2008 R2, in which I have configured the maintenance plan for backups (a full back on Tuesdays, Thursdays and Saturdays at 00, three transactional logs at 4, 5 and 6 am, and then at 7 am a differential, and so on, finishing with a differential backup at 11 PM). At the beginning of July, there was a problem with a full backup that was not done, because of lack of space (this problem was July 5th), then the differentials began to increase in size, up to 10 GB, when the full was done, the differentials decreased in size to 1 GB (before this, the differentials had a maximum size of 800 MB), the problem is that every day it increases in size, until today, when each differential weighs 6 GB, the full backup's size is about 96 GB because the database is too old. and I've seen some strange behavior, when the plan gets to the differentials, at 7:46 (for example), the file is finished creating, and it weighs 500mb, but then, 1 minute later, it's like the differential is overwritten, and there it increases in size up to 3GB. What could be causing the error? Maybe it's due to something with the TRUNCATE of the full backup? How can I solve this? I've already tried doing a new manual full backup (on a day that it's not done, at 00 am), and at the moment that it finished being done, a new manual differential, but that didn't solve it. The queries that I run: FULL BACKUP: BACKUP DATABASE [xxx] TO DISK = N'\xxx\SQLServerDatabases\Backups\full_reset.bak' WITH INIT, NAME = N'Full_Reset', SKIP, STATS = 10; DIFFERENTIAL BACKUP: BACKUP DATABASE [xxx] TO DISK = N'\xxx\SQLServerDatabases\Backups\diff_reset.dif' WITH DIFFERENTIAL, INIT, NAME = N'Diff_Reset', SKIP, STATS = 10;39Views0likes0Commentsexecution SP via linked server from SQL Job
Hello colleagues, we have next environment: 1. SQL Server standard edition 2022 16.0.4185.3. 2. SQL Server Job service running under domain managed service account. Category type is Data collector. 3. Job owned by [sa] 4. Job execute stored procedure using next command exec RemoteServer.[DB].[dbo].Load_RTL 0 5. Linked server RemoteServer is MS OLEDB Provider and configured to use (Be made using this security context). Login is a SQL Login with provided password. When job is started, it trying to execute remote SP using SQL Server Agent account, but not linked account which I indicated above in line №5. Why and how to change this so remote SP executed using linked server account? Thank you.38Views0likes0Comments
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, 2025404Views1like0Comments
- English follows Japanese. こんにちは、 SQL Server サポート チームです。 今回は、SQL IaaS Agent 拡張機能と Azure 上の SQL 仮想マシン リソースについて解説します。 SQL Server IaaS Agent 拡張機能とは SQL Server IaaS Agent 拡張機能は、Azure Porta...Sep 17, 2025119Views2likes0Comments