|
|
|
|
|
|
|
| Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Strange String Splits | |
When I run this code, how many rows are returned?
DECLARE @meals NVARCHAR(1000) = N'夕食昼食朝食' DECLARE @s NVARCHAR(1) = N'食' SELECT value FROM STRING_SPLIT(@meals, @s) GO | |
Think you know the answer? Click here, and find out if you are right. | |
| Yesterday's Question of the Day (by Uwe Ricken) |
Locking Hierarchies You have a table [dbo].[orders] without a Clustered Index (Heap). The table does not have any other nonclustered indexes! You rund the following command in Read Committed Isolation Level: SELECTo_orderdate,
o_orderkey,
o_custkey,
o_storekey
FROMdbo.orders
WHEREo_orderkey = 3877;What locking hierarchy will Microsoft SQL Server use?
Answer: (IS) on the object (table) -> (S) on the page Explanation: SQL Server doesn’t need to take a key-level (row-level) S-lock if the page-level lock already covers the access semantics safely and efficiently. In a HEAP table an S-Lock on a row can not happen in READ COMMITTED Isolation as default! SQL Server must always scan the whole table even you are selecting one single row. Only one options is available to use an S-Lock on a row in a HEAP and that is the table hint (ROWLOCK). Ref: Transaction locking and row versioning guide - https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-transaction-locking-and-row-versioning-guide?view=sql-server-ver17 |
| Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
| SQL Server 2019 - Development |
| Collation errors...what is best way to deal with it? - Hi I have a SP that occasionally get this error: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation. The query is close to 1000 lines long so I have no idea where this is without examining each line. Is there a way to set the collation in the SP […] |
| Was the index created or not? - Hi everyone I am getting an error when I create the index but I don't get any errors when I save and run the SP. Does this mean the index was created or not? Is there a way to verify? The index is on a temp table. Thank you |
| Some query values change when query is run but not others. Why? - Hi everyone I have a 1000 line SQL query that is too long to put here so I will explain the basic logic and what the issue is. The query processes stock market data and produces a daily metric for each symbol. There are close to 4000 symbols that get the metric created daily. I […] |
| using different credentials when debugging ssis - hi, now and then i want one connection in my ssis pkgs to use different creds from others. It comes down to my admin vs my regular id. And that basically i'm somewhat limited when i run vs under my admin acct. Is there a way to do this? |
| Integration Services |
| SSIS Package is reporting successful however is short 80-100k records - Good morning all, I have been running into a very random weird issue that I am hoping someone has experienced and can stop my head from spinning. We have 4 environments we run about 150 flows that connect to Oracle to pull data into 4 different SQL Servers. Let's called them Dev1, Dev2, Test and […] |
| Editorials |
| We Should Demand Better - Comments posted to this topic are about the item We Should Demand Better |
| Article Discussions by Author |
| Estimated Rows - Comments posted to this topic are about the item Estimated Rows |
| Identify Unused Tables in SQL Server and Azure SQL - Comments posted to this topic are about the item Identify Unused Tables in SQL Server and Azure SQL |
| SQL Server Advanced Troubleshooting and Performance Tuning: Best Practices and Techniques - Comments posted to this topic are about the item SQL Server Advanced Troubleshooting and Performance Tuning: Best Practices and Techniques |
| T-SQL Fundamentals - Comments posted to this topic are about the item T-SQL Fundamentals |
| Murach's SQL Server 2022 for developers - Comments posted to this topic are about the item Murach's SQL Server 2022 for developers |
| AlwaysON health check alerts - Comments posted to this topic are about the item AlwaysON health check alerts |
| Bat and SQL script to generate DB user permissions for all Databases in SQL server - Comments posted to this topic are about the item Bat and SQL script to generate DB user permissions for all Databases in SQL server |
| PWDCompare - Comments posted to this topic are about the item PWDCompare |
| SQL Server 2022 - Development |
| Parameter sniffing issue with different minutes as opposed to using midnight - Hej, I'm not facing this issue but as I was working another parameter sniffing issue I came to think about this and if it might cause an issue? So I'm more looking for your experience in the past and more an answer of kind "Nah, you'r good" or "You should definitely go with rounding to […] |
| |
| ©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |