Recent Discussions
Temporal Table - Change the ValidFrom Time
Sql Server 2022 - We needed a new 'Bonus' value to be active from 11/01/2025 06:00:00. I created a one time SQL job to update the temporal table for the Bonus value (going from 2.175 to 2.00) to run at 11/01/25 06:00:00. In the temporal table, the valid from is (converted to the local time) 2025-11-02 06:00:00.5656752 -06:00. If I pass FOR SYSTEM_TIME FROM '2025-11-02 06:00:00' TO '2999-01-01 23:59:59.999', I will get the previous since the job was just over a 1/2 second late. I've read articles talking about turn off versioning, then updating the History and current tables, then turning versioning back on. Seems like thats not possible with a generate always ValidFrom. I tried to create a temporal table where Validfrom as GENERATED BY DEFAULT but that didn't work. Is there a way I can get my validFrom to exactly 11/01/2025 06:00:00? Is there a better way in the future to get things set to exactly a desired time?51Views0likes2CommentsQuery on sys.dm_db_index_usage_stats slow
Hi, we discovered that queries on sys.dm_db_index_usage_stats are getting very slowly when the sql server is running for a longer time without restart. The execution time is up to 30 seconds for the following query: SELECT object_name(object_id) objectName, last_user_update FROM sys.dm_db_index_usage_stats WHERE database_id=db_id() We get the following query plan: The Actual Rows in LOGINDEXSTATS are about 2 million. We found 2 similiar cases by searching the internet: https://stackoverflow.com/questions/52165370/query-against-sys-tables-sys-dm-db-index-usage-stats-slow https://www.linkedin.com/pulse/sql-server-2014-object-dependencies-dmvdmf-slow-andrea-bruschetta We tested the workaround (UPDATE STATISTICS sys.*** WITH FULLSCAN;) without success. How can we increase performance without restarting the database? Regards Dominik35Views0likes0CommentsSQL Server - Always On High Availability Group Setup
We have an Always On High Availability Group setup with three database servers — two on the same subnet and one on a different subnet. The application server interacts with these database servers through the AG listener. Currently, this setup is running with application version X, and we have received a new application version Y for upgrade/migration (which includes database changes). To perform the application update, please clarify the recommended approach: Should I remove the database from the Availability Group and point to the primary replica to continue with the application update? or Can I proceed with the application update while the Always On configuration remains active, pointing to the AG listener?39Views0likes1Comment"ALTER DATABASE CURRENT SET ALLOW_SNAPSHOT_ISOLATION ON" does not finish for several hours
I have tried enabling snapshot isolation on several SQL Server instances (2017 and 2022 developer editions) in single user mode with the same huge DB (4 TB) but the command does not finish even after 6 hours... ALTER DATABASE CURRENT SET ALLOW_SNAPSHOT_ISOLATION ON Session is waiting on "ENABLE_VERSIONING" and I don't see any noticeable I/O activity on the Windows disk itself.24Views0likes0CommentsHow Can a Company Receive Support from Microsoft for SQL Server Enterprise with Software Assurance?
Hello, I’m currently managing SQL Server under the following licensing agreement: SQL Server Enterprise Core Single Language License & Software Assurance Open Value | 2 Licenses | No Level | 1 Year | Acquired Year 1 | AP I’ve been informed that Software Assurance (SA) no longer includes technical support for SQL Server. Could you please confirm if this is correct? If our organization needs technical support from Microsoft for SQL Server, I would like to clarify the following: Is it mandatory to have a Unified Support contract or to purchase incidents via the Microsoft Services Hub in order to receive support? Regarding Services Hub, I’ve heard that support incidents must be purchased using a personal Microsoft account (MSA). If this is true, can this method be used to receive support for corporate environments? Thank you in advance.25Views0likes0CommentsSSMS Dialog Box issue
Using SSMS 21.5.14, but I know this issue has existed in previous versions of SSMS. When opening a View in Design mode in SSMS, if the View contains a UNION, SSMS pops up a dialog box like the one below. The dialog box immediately hides behind the active SSMS window and sometimes you are not even aware that it has appeared. If I do notice it immediately, I am not able to click the OK button to clear it. This dialog box sits happily in the background and I can still move around the SSMS interface, however it does some odd things like ignoring certain keypresses when editing stored procedures or trying to make changes in a Query window. The only option is to exit SSMS completely and start again. When I do exit SSMS, I get the following message: Has anyone else experienced this and is there a way to prevent it happening? TIA!65Views0likes2CommentsSQL Server 2025 – Native JSON Size Limit?
Hi Guys, I am exploring SQL Server 2025 to store JSON documents using the native JSON data type. I have gone through several Microsoft SQL technical documents but couldn’t find the maximum size of the native JSON data type. I believe it hasn’t been officially published yet. Does anyone have any insights? Thanks, Tushar69Views0likes1CommentWhy is SQL Server only storing 4000 characters in an NVARCHAR(MAX) column?
Hi Guys, I'm trying to insert a string with 10,000 plain characters (just repeated 'A's) into a column defined as NVARCHAR(MAX) in SQL Server. But LEN(Content) always returns 4000, not 10,000. I’ve verified that the column is NVARCHAR(MAX) and used the N prefix for Unicode. Still, the data seems to be truncated. What could be causing this? Is there something I'm missing in how SQL Server handles large strings? Tried this: CREATE TABLE LargeTextExample ( Id INT PRIMARY KEY IDENTITY(1,1), Content NVARCHAR(MAX) ); DECLARE @LongText NVARCHAR(MAX); SET @LongText = REPLICATE(N'A', 10000); INSERT INTO LargeTextExample (Content) VALUES (@LongText); SELECT LEN(Content) AS CharacterCount FROM LargeTextExample; Thanks, TusharSolved104Views0likes2CommentsSSMS 21/22 Error Upload BACPAC file to Azure Storage
Hello All In my SSMS 20, I can use "Export Data-tier Application" to export an BACPAC file of Azure SQL database and upload to Azure storage in the same machine, the SSMS 21 gives error message when doing the same export, it created the BACPAC files but failed on the last step, "Uploading BACPAC file to Microsoft Azure Storage", The error message is "Could not load file or assembly 'System.IO.Hashing, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. (Azure.Storage.Blobs)" I tried the fresh installation of SSMS 21 in a brand-new machine (Windows 11), same issue, Can anyone advice? Thanks83Views0likes2CommentsREPL55012 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.103Views0likes4CommentsSQL 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.52Views0likes1CommentBug: "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?107Views0likes1CommentDo 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 advance67Views0likes2CommentsSQL 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 you186Views0likes4CommentsSQL 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.105Views0likes1CommentFail 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?40Views0likes0CommentsHow 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.73Views0likes1CommentSQL 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 do271Views0likes7Comments
Events
Recent Blogs
- SQL Server Management Studio (SSMS) 22 GA is now available The SSMS team is thrilled to announce the general availability release of SQL Server Management Studio (SSMS) 22! This has been a busy yea...Nov 11, 2025121Views0likes0Comments
- SQL Server Management Studio (SSMS) 22 Preview 5 was released this week and includes updates to GitHub Copilot in SSMS.Nov 06, 2025534Views0likes4Comments