Recent Discussions
Sql Server Credential Manager
I am trying to add a new domain login to Credential Manager in Windows 11. I have no problem adding a Sql Server credential such as myserver.internal.company.com But if I try adding a named server such as myserver\instancename.internal.company.com I cannot add it. I have also tried 192.168.0.1\instancename, still cannot add. How do I add a named instance int Credential Manager? I cannot seem to find any help on this via a web search. I can use runas netonly, no problem, but I would like to use Credential Manager. Thank you for any help.8Views0likes0CommentsSSRS subscription
Hi all, I hv a question about SSRS subscription under mssql 2022 STD, I saw when i subscript to a report, it will create a job under SSMS jobs. I would like to manage the report subscription not run on the specified date store in some table in the database. Is it possible to run another job to use sp_update_job to disable the job when date is find in the table, and enable the job when the date is not find in the table. Because the SSRS's job contain a remarks that "modify this job will make database incompatible", im not sure is it work. thanks in advance.45Views0likes2CommentsReading a non-rounded value from Excel cells using OPENDATASOURCE
Reading a non-rounded value from Excel cells using OPENDATASOURCE I have the following situation: I have an Excel document that contains in a cell a value 10,45. Format of the cell is “# ##0,0;-# ##0,0”. Therefore, the value 10,45 is displayed in Excel as rounded value “10,5” – because of the format allows only one digit in the decimal part. I have the following T-SQL code that reads the Excel: CREATE TABLE #from_excel ( rate decimal(20, 10) ) INSERT into #from_excel (rate) SELECT REPLACE(F1, N',', N'.') FROM OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0','Data Source=TheExcelPathIsHere ;Extended Properties="EXCEL 12.0;HDR=No;IMEX=1"')...['NameOfTheSheetInTheExcelFile$'] This way the value 10,45 from the file will be put into #from_excel.rate as value 10,5. Is it possible somehow (not changing the format of the cell, this is important) have a query that reads the non-rounded value; i.e. to have 10,45 in the #fromexcel.rate after the reading.41Views0likes3CommentsTrigger is hanging up the database
Hi, I need to send a database email when the status field of a newly inserted field is <> '0'. I have a trigger that works fine at another location but will cause the database to not populate when enabled at this location. I have tested the database email and successfully sent and received an email from a query using EXEC msdb.dbo.sp-send-dbmail and the lines to follow as seen below in the code. If I just run the query the email goes out, but when I use it as a trigger just enabling it causes the database to hang up. USE [AK_Mid_TV] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER TRIGGER [dbo].[TV Front Image Alarm Alerts] ON [AK_Mid_TV].[dbo].[TV Data] FOR INSERT AS SET NOCOUNT ON; DECLARE @tableHTML NVARCHAR(MAX); SET @tableHTML = N'<h1>TORPEDO VISION FRONT ALARM ALERT</H1>' + N'<table border = "1">' + N'<tr><th>Car ID</th><th>Image Time</th>' + N'<th>Front Alarm Level</th><th>Front Alarm Temp</th><th>Direction</th>' + CAST ( ( SELECT td = dbo.[TV Data].[Car ID], ' ', td = dbo.[TV Data].[Image Time], ' ', [td/@align] = 'center', td = dbo.[TV Data].[Front Image Alarm Status], ' ', [td/@align] = 'center', td = format(dbo.[TV Data].[Front Temp F], '#,#'), ' ', [td/@align] = 'center', td = dbo.[TV Data].[Direction Label] FROM dbo.[TV Data] where [Image Time] in (SELECT MAX([Image Time]) from dbo.[TV Data]) and [Front Image Alarm Status] <> '0' FOR XML PATH ('tr'), TYPE ) AS NVARCHAR(MAX) ) + N'</table>'; If @tableHTML <> ' ' EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Alarm emails', @recipients ='email address removed for privacy reasons' @copy_recipients = 'email address removed for privacy reasons', @subject = 'TV Alarm Alert', @body = @tableHtml, @body_format = 'HTML';Solved96Views0likes5CommentsTrigger is hanging up the system.
Hi, I need to send out a database email when the status field is <> '0' for a newly inserted record. I have a trigger that works elsewhere, but is hanging up the system at this location. When I say "hanging up the system" I am referring to the database not populating. The database will populate after the trigger is disabled and another insert occurs. Below is the code for the trigger. I have checked and the test database email went out and was received. I have also successfully sent out and received an email from a query using just the Line EXEC msdb.dbo.sp-send-dbmail and the lines that follow from below. It is something with the trigger is all I can come up with. I would greatly appreciate any input. USE [AK_Mid_TV] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER TRIGGER [dbo].[TV Front Image Alarm Alerts] ON [AK_Mid_TV].[dbo].[TV Data] FOR INSERT AS SET NOCOUNT ON; DECLARE @tableHTML NVARCHAR(MAX); SET @tableHTML = N'<h1>TV FRONT ALARM ALERT</H1>' + N'<table border = "1">' + N'<tr><th>Car ID</th><th>Image Time</th>' + N'<th>Front Alarm Level</th><th>Front Alarm Temp</th><th>Direction</th>' + CAST ( ( SELECT td = dbo.[TV Data].[Car ID], ' ', td = dbo.[TV Data].[Image Time], ' ', [td/@align] = 'center', td = dbo.[TV Data].[Front Image Alarm Status], ' ', [td/@align] = 'center', td = format(dbo.[TV Data].[Front Temp F], '#,#'), ' ', [td/@align] = 'center', td = dbo.[TV Data].[Direction Label] FROM dbo.[TV Data] where [Image Time] in (SELECT MAX([Image Time]) from dbo.[TV Data]) and [Front Image Alarm Status] <> '0' FOR XML PATH ('tr'), TYPE ) AS NVARCHAR(MAX) ) + N'</table>'; If @tableHTML <> ' ' EXEC msdb.dbo.sp_send_dbmail profile_name = 'Alarm emails', @recipients ='email address removed for privacy reasons', @copy_recipients = 'email address removed for privacy reasons', @subject = 'TV Alarm Alert', Body = @tableHtml, Body_format = 'HTML';25Views0likes1CommentUnable to drop a user on SSISDB
Hi, I am unable to drop the user from the SSISDB, I am getting the below error, has anyone experienced the same issue? "The database principal has granted or denied permissions to catalog objects in the database and cannot be dropped. The transaction ended in the trigger. The batch has been aborted. (Framework Microsoft SqlClient Data Provider)" Regards, Noma72Views0likes3CommentsAnalysis Server Roles from Entra workstation
We have Analysis Server solution, maintained and deployed from Visual Studio, where the roles defined use AD groups. This worked perfectly as long as long as the machine used was on the same domain as the groups or was hybrid joined. On a new laptop that is Entra-only joined we do see a curious issue. The AD where the groups are located is a fully trusted domain. In SSMS (version 20.2) we now see this behavior in the Object Explorer: Connect to SQL Server Database Engine On-premise server A Navigate to Security -> Logins -> Right-click and select New Login Click on Search Click on Locations Full list of available domains to search is available Connect to SQL Analysis Services On-premise server A (so the same server) Navigate to Databases -> {Database name} -> Roles -> Right-click and select New Role Click on Membership and Add Click on Locations Only the local computer is available This prevents us from creating new roles with an AD group membership. Please note that everything else is working fine. Browsing as another AD user in any way works perfectly. Any ideas to why it behaves differently when connecting to database engine versus analysis services or what we can do to resolve this issue? PS! We see similar issues in Visual Studio if we try to edit roles in a Analysis Services Project. The assumption is that these both rely on the same underlying services to lookup objects on the AD domain. Thus if we resolve the SMSS issue we hope that also resolves the VS AS project issue. Regards, StigSolved57Views0likes2CommentsChange SQL Login to AD service account for Link server
Hi Everyone, I tried to change account used to impersonate from SQL account to AD service account for link server however im getting below error. The AD service account has sys admin rights on the SQL servers. Access to the remote server is denied because no login-mapping exists. (Framework Microsoft SqlClient Data Provider) Any ideas how to resolve? Regards58Views0likes4CommentsSSRS 2022 not able to connect SQL Server 2022
Hi, on SQL Reporting Service Configuration Manager 2022, when i try to connect SQL 2022 instance, its enforcing encryption. However, during the SQL 2022 i just installed by default and haven't configured any SSL certificate or activated encryption. Moreover, MSSQLSERVER service account also default account which comes with installer. How can i disable or bypass this issue in order to configure SQL Reporting Service ? Regards,1.1KViews2likes7Commentsproblem restoring a backup
I have a backup file (xxxx.bak) in my c:\trmp directory. When I launch SSMS signed on as "sa" and try to restore this database, i get this window: I am not able to enter anything for "Database" and the dropdown is empty. Then if I switch it to "Device" I get this window: Now, under "Destination" I am able to enter a database name, i.e. the name I want the database to be referred to after I restore it. However, note the message at the top of the window: No backupset selected to be restored. How do I resolve this issue? MurraySolved133Views0likes8CommentsUnable to restore a backup
I have a backup named: xxxx.bak currently in my Temp directory. This backup was made from SSMS V20. I recently installed SSMS V21 and unable to restore this backup. Steps to reproduce: Open SSMS connected as "sa" Highlite "Database", right click to select "Restore Database" The window opens, I choose "General" under "Select a page", no "databases" are listed. I then switch to "device", again no "databases" are listed. I then look under "Destination, there are several database listed there but not the one I wish to restore. I'm not sure what step, if any, that I am missing. MurraySolved30Views0likes1CommentSQL 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 MurraySolved142Views1like4CommentsSql to calculate quarterly/annual aggregation aside of monthly numbers
Hi, I am struggling to calculate amounts based on mtd amounts w/o using a cursor. Any idea? create table #raw(quarter int, name varchar(10), year int, month int, amount decimal(19,2)) insert #raw(quarter, name, year, month, amount) values(1, 'aa', 2025,1,2.0),(1, 'bb', 2025,1,4.0),(1, 'cc', 2025,1,1.0), (1, 'aa', 2025,2,6.0),(1, 'bb', 2025,2,8.0), (1, 'aa', 2025,3,10.0),(1, 'bb', 2025,3,2.0),(1, 'dd', 2025,3,4.0), (2, 'ee', 2025,4,9.0),(2, 'bb', 2025,4,3.0),(2, 'cc', 2025,4,3.0),(2, 'aa', 2025,4,1.0), (2, 'ee', 2025,5,15.0),(2, 'bb', 2025,5,1.0),(2, 'cc', 2025,5,2.0),(2, 'aa', 2025,5,7.0), (2, 'cc', 2025,6,8.0),(2, 'aa', 2025,6,9.0) Annual calc is easy, but not sure how to add quarterly number aside: select mtd.quarter, mtd.name, mtd.year, mtd.month, mtd.amount, sum(ytd.amount) as ytd from #raw mtd join #raw ytd on mtd.name = ytd.name and mtd.year = ytd.year and mtd.month >= ytd.month and mtd.quarter >= ytd.quarter group by mtd.quarter, mtd.name, mtd.year, mtd.month, mtd.amount order by 1,3,4,2 Goal is to get a report like this:Solved53Views0likes2CommentsCSV file size from "Save Results As..." versus exported via SSIS Package / Export Wizard
When exporting query results from the grid using "Save Results As...", I'm consistently creating CSV files that are half the size of CSV files created by exporting via the Import/Export Wizard (and the resulting SSIS Package). Exact same query used for both, same results, same number of records etc. I believe this has to do with the file encoding used by each export process. I know this is not a precise science, but based on how Notepad interprets the resulting files, the encoding of the "Save Results As..." files is "UTF-8 with BOM", while the SSIS Package generates a "UTF-16 LE" file. I've tried a variety of approaches to try to get the Import / Export Wizard to mimic the "Save Results As" encoding without success. Changing the Code Page field on the "Choose a Destination" screen to "65001 (UTF-8)" results in the dreaded "DT_NTEXT not supported with ANSI files" error upon export due to nvarchar(max) data types in the source table. That can be resolved by checking the Unicode box on the "Choose a Destination" page, but checking Unicode also disables the Code Page dropdown. Even if you select "65001 (UTF-8)" in Code Page and then check Unicode, it still produces a UTF-16 encoded file. Two questions at this point: 1) How does the "Save Results As..." function in the query grid avoid the DT_NTEXT error and produce a UTF-8 encoded file? 2) If I tried to edit the package in SSIS Designer, would I have more control over the encoding and be able to mimic the "Save Results As..." file sizes? This would take a bit of effort (installing Visual Studio data tools, learning how to use it, etc) so if that's a dead end I'd rather not pursue it.28Views0likes0CommentsPossible GENERATE_SERIES memory leak?
Hey all, We've been experimenting with SQL Server 2022 features and stumbled upon what looks like a memory leak on every execution of the GENERATE_SERIES() function. A script that demonstrates it: SELECT * FROM sys.dm_os_memory_clerks WHERE [type] = 'MEMORYCLERK_SOSNODE' DECLARE @i INT = 1 WHILE @i <= 100000 BEGIN IF (SELECT COUNT(*) FROM GENERATE_SERIES(1, 1, 1)) != 1 BREAK SET @i += 1 END -- ~9ΜΒ leaked, ~96 bytes per iteration, on SOS_Node 0 SELECT * FROM sys.dm_os_memory_clerks WHERE [type] = 'MEMORYCLERK_SOSNODE' It can be reproduced on fresh SQL Server installations, in an empty database with default settings, on: Windows Linux (Ubuntu/docker) SQL Managed Instance on Azure It does NOT reproduce on Azure SQL. Using docker, we've tried every build from RTM up to CU12 that was just released, the behavior is exactly the same. The memory does not seem to ever be released. With enough iterations, SQL Server reaches a point where it cannot execute anything anymore. (when testing, lower the max memory setting to get there faster). Also captured a trace (with Tracking page allocations / freed for MEMORYCLERK_SOSNODE) and using SQLCallStackResolver this call stack appears thousands of times: 00 SqlDK!GenericEvent::PublishAndCallAction 01 SqlDK!XeSosPkg::page_allocated::Publish 02 SqlDK!MemoryClerkInternal::AllocatePagesWithFailureMode 03 SqlDK!MemoryClerkInternal::AllocatePages 04 SqlDK!CMemThread<CMemObj>::PbGetNewPages 05 SqlDK!TVarPageMgr<0>::PbAllocate 06 SqlDK!CMemObj::Alloc 07 SqlDK!CMemThread<CMemObj>::Alloc 08 SqlDK!operator new 09 sqllang!CTVFInfoGenSeries::PtiUserArgumentType 0a sqllang!CSTVFGenSeries::Init 0b sqlmin!CQScanTVFStreamNew::Open 0c sqlmin!CQScanNew::OpenHelper 0d sqlmin!CQScanStreamAggregateNew::Open 0e sqlmin!CQueryScan::UncacheQuery 0f sqllang!CXStmtQuery::SetupQueryScanAndExpression 10 sqllang!CXStmtQuery::InitForExecute 11 sqllang!CXStmtQuery::ErsqExecuteQuery 12 sqllang!CXStmtCondWithQuery::XretExecute 13 sqllang!CExecStmtLoopVars::ExecuteXStmtAndSetXretReturn 14 sqllang!CMsqlExecContext::ExecuteStmts<1,1> 15 sqllang!CMsqlExecContext::FExecute 16 sqllang!CSQLSource::Execute 17 sqllang!process_request 18 sqllang!process_commands_internal 19 sqllang!process_messages 1a SqlDK!SOS_Task::Param::Execute 1b SqlDK!SOS_Scheduler::RunTask 1c SqlDK!SOS_Scheduler::ProcessTasks 1d SqlDK!Worker::EntryPoint Note the CSTVFGenSeries::Init call. There's no corresponding free operation logged. Anyone else seeing this?437Views1like1CommentSQL connector for Azure Key Vault on Linux
Hi everybody, after having successfully configured EKM (to access Azure Key Vault) and encrypted a database with a asymmetric key on a SQL running on a windows VM, i am trying to replicate the same configuration in SQL (2022, CU19) running in a linux container. I cannot find the CRYPTOGRAPHIC PROVIDER (from the documentation it should be built-in), nor create it from file (tried in many ways using the windows dll, i get an error 33027 without additional informations). The guide bellow (see last link) suggest to skip step 3 and 4, and proceed with step 5. But the next steps (create credential, create asymmetric key) requires to refer the cryptographic provider. Can someone supply more information for this step? Thks in adv. Stefano Links: https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault?view=sql-server-ver16&tabs=portal) https://techcommunity.microsoft.com/blog/sqlserver/enabling-azure-key-vault-for-sql-server-on-linux/409124841Views0likes0CommentsTransaction was deadlocked on lock resources with another process ??
Hi, We have a cognos datastage job that updates a table. It fails with an error that the table is locked., see below ini_PerformanceManagement_tblEmployees,0: ODBC function "SQLExecute" reported: SQLSTATE = 40001: Native Error Code = 1,205: Msg = [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Transaction (Process ID 67) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. (CC_OdbcDBStatement::executeUpdate, file CC_OdbcDBStatement.cpp, line 1,058) Anyone any ideas about how to resolve this? Thanks for your time, Ollie72Views0likes1CommentSSMS - Display time query was executed
Would you like to see the time that you started a query in SSMS? I do because I normally run multiple queries and need to know when I started the first query, and second, etc. Please upvote my suggestion to display the query start time in SSMS. It's under consideration given the community's demand. Thanks!58Views0likes2CommentsSSMS Edit rows hangs if open for long time
If you have Edit rows open for a long time (~1h) and submit a change, SSMS (v20.2) sometimes hangs. There's no errors or anything visible and the application becomes unresponsive (sometimes there's a "SSMS is busy"-notification and has to be killed. Feels like the value submission is missing refresh token and/or error response handling. Update does not get processed, but always a bit scary if I had something else open that was. Not sure if there's a way to report such bugs.128Views1like4Comments
Events
Recent Blogs
- The 20th cumulative update release for SQL Server 2022 RTM is now available for download at the Microsoft Downloads site. Please note that registration is no longer required to download Cumulative up...Jul 10, 2025359Views1like0Comments
- The Security Update for SQL Server 2019 RTM CU32 is now available for download at the Microsoft Download Center and Microsoft Update Catalog sites. This package cumulatively includes all previous sec...Jul 08, 2025308Views0likes0Comments