SP execution time varies with different environment
Dev environment is restored with the latest Test. When a SP with same set of parameter is executed against Test as well as Dev, the execution time is differing with both the environments. In Test it takes 1.45 mins, whereas in Dev it is 3.16/3.08…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
convert returns conversion error but try_convert does return the correct value
Hi All, I have the following case statement in a TSQL script, which returns the correct negative decimal value, in the rows that acually have a value try_convert (decimal (18,6), max (case when [databody.daysQuality.testResults.testType] =…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
Syntax - How to use variable in LIKE clause
Trying to use a variable in the LIKE clause of a SELECT statement. Hope this is simple, but available guidance hasn't worked. As seen below, query works when a "fixed" value is used with wildcard characters, but I haven't managed to get it with…
elapsed_time value more than query execution time?
I did take query from here in order to check performance of our queries. Executed a SP which took execution time of 1 min 45 seconds. Ran the query from the link which uses the view 'sys.dm_exec_query_stats' Highlighted rows in the screenshots are…
Microsoft SQL Server Studio - Dark Mode
Is there any official method to use Microsoft SQL Server Management Studio Studio with Dark Mode?
![](https://techprofile.blob.core.windows.net/images/XHDS-x5WFEm9V1LmsTe7Fg.png?8DBFD6)
ID's coming back as nulls are not appearing in my data set
I am trying to create a, intergrity check that bring back data after a record has been cancelled after a certain event. In my query. I am joining to a few tables and I can see all the old cancelled record. When I then cancel any new records, some IDs I…
Unexpected truncation error when inserting from UTF8 to non-UTF8 collation
I believe I am hitting a bug with moving data from a UTF8 to a non-UTF8 collations in SQL Server 2022 CU13 (running under Linux but assuming for now this issue is not related). The issue is that MSSQL appears to be determining the width of a string for…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
“user_scans” of table “sys.dm_db_index_usage_stats”
I am trying to find answer to the below. What exactly the scan means for the field "user_scans" being with the table "sys.dm_db_index_usage_stats" ? Like, there are tables in our prod which aren't used for sure as the module is…
SSMS freezes on student computer when I demostrate TSQL queries using MS Teams on my computer
I lecture Microsoft SQL courses from my home using Microsoft Teams. I installed the latest edition of SSMS & SQL Dev 2019 Ed on my Lenovo laptop. During the lecture I would share my query window with the delegate to demonstrate TSQL queries. The…
Get Global Primary details from All the replicas in Distributed AlwaysOn
In Distributed AlwaysOn, I could not find any DMVs in SQL Server which could provide the details about Global Primary from replicas in Forwarder side (both Primary Forwarder and its local replicas). Is there a way to at-least pull the Global Primary…
Querying table index stats not working
I am trying to query my tables index fragmentation in Azure Synapse studio with query: SELECT IPS.Index_type_desc, IPS.avg_fragmentation_in_percent, IPS.avg_fragment_size_in_pages, IPS.avg_page_space_used_in_percent, …
Partition by filter
Hey Team I have table where A values comes then E value should be filter or else E value should be there partition by data and mpr column expected values
transpose row data into columns
Hope I'm asking this correctly. I have a table in this format: I need to have the Unique ID and the account numbers from both stores all in the same record. Like this: How can I accomplish this in SQL? Is this some kind of PIVOT or UNPIVOT? What…
unable to convert unique identifier
Hi Team, unable to convert this value as an unique identifier and getting null values SELECT try_convert(uniqueidentifier,''9UIC32D1-932-4V03-45E9-FGSGDASASDATY'')testid
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
WHY Index Scan Instead Of Seek While Joining Big Table With #Temp Table
In my sql server 2016 database, I have a table 'BigData' having around 50 million rows and a Temporary table #TempID which contains 600 rows. CREATE TABLE BigData (ID INT IDENTITY(1,1) PRIMARY KEY, OtherID INT, Comment nvarchar(max),…
Syntax Error When Attempting to run PREDICT function against table in dedicated pool in Synapse Studio
I am attempting to complete the tutorial listed here : https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-sql-pool-model-scoring-wizard I am able to complete all of steps until I get to the final step, where I use Synapse…
Unable to Uninstall SQL Server 2019
I'm trying to uninstall SQL Server 2019 (64-bit) from the Control Panel, but I'm encountering errors during the uninstallation process. I was able to remove all the features, but I received a prompt to restart my system. After restarting, I noticed that…
How to fix Duplicate Output in sql server when using Distinct Create performance Issue
Respected Techie, I am facing very Bizarre issue of Duplicate Record in sql Output. May someone please help me with their expertise. I am very much Thankful for your kind help. The Problem I am facing is I am brining column from multiple dimension table…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
select top results without selecting columns
select top results without selecting columns?
i have few snapshot transactions, now i need to put nolock/read uncommit for perticular table
hi, I have few snapshot transactions , now my admin has informed me that put no lock in all tables in snapshot transactions, as it was blocking locking deadlocking with others. so I suggested to put read uncommited instead of snapshot when u are…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)