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…
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…
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),…
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…
Microsoft SQL Server Studio - Dark Mode
Is there any official method to use Microsoft SQL Server Management Studio Studio with Dark Mode?
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…
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…
Benefits and disadvantages of WITH (NOLOCK)
Benefits and disadvantages of WITH (NOLOCK). Also is there other commands that can serve different use cases.
delimited split gives null for some items
hi all, I am using a function to split a string into multiple rows. The function is available here: https://www.sqlservercentral.com/articles/tally-oh-an-improved-sql-8k-%e2%80%9ccsv-splitter%e2%80%9d-function What I am trying to figure out is how to…
bit null ,0
Hey Team, have column1 datatype (bit,null) so it only takes values like 0 and 1 but i want true , false as well...how to get that in same datatype or in different one
Conversion failed when converting the varchar value to data type int in a JOIN
So we have a SQL Server Stored Procedure that has a JOIN using a data column that is defined in the "To Be" Joined Table as INT. The data column in our joining criteria is defined as a data type NVARCHAR(100). So the SQL Server Stored Procedure…
SSMS not flagging basic errors after IIF statement
DMF_SSMS_SQL_IIF_Err.pdf I just wanted to notify Microsoft of an error I believe I found with SSMS error notification. Going thru some scripts, I came across one that had a CASE and IIF in it. I accidently did a typo, no errors, but failed. I then…
Trying to Bulk Insert SSN data into an always Encrypted column and is not working. Any guidance please.
I am having trouble Bulk inserting the SSN data from a simple SQL table to a table where I have an always encrypted column. I am not getting any right solution after googling around. Please share if anyone has done similar kind of work. Thanks, SK.
Querying with Filename and Filepath Functions in Synapse Serverless
Hello, I have been reading about using filename() and filepath() in t-sql statements with synapse serverless sql: https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/query-specific-files#functions Wondering if for the following statement:…
Can't figure out why The select list for the INSERT statement contains fewer items than the insert list
Hi everyone, I want to create a stored procedure that will create a table and return value, but I got this message: Msg 120, Level 15, State 1, Procedure sp_Month01_FYCalendar, Line 36 [Batch Start Line 9] The select list for the INSERT…
SQL Server - Question marks inserted with Hebrew collation
SQL Server 2019, Developer edition, Windows 10. The client is SSMS 18. When database is created with Hebrew collation, for example, Hebrew_CI_AI, there is no problem, Hebrew strings are inserted and being read as they are. When database is created…
Exception problem
Hi, I've got issue due to this line below. reader = cmd.ExecuteReader(); Can it be owing to no record returned?