Comments for {coding}Sight https://codingsight.com/ Blog for SQL Server DBAs and Developers Mon, 17 Jul 2023 08:20:35 +0000 hourly 1 https://wordpress.org/?v=6.5.2 Comment on How to Protect MySQL Databases from Ransomware Campaigns by Bo Bromwell https://codingsight.com/how-to-protect-mysql-databases-from-ransomware-attacks/#comment-483 Thu, 16 Sep 2021 00:11:56 +0000 http://codingsight.com/?p=14501#comment-483 I simply want to tell you that I am new to blogging and site-building and seriously enjoyed this page. More than likely I’m likely to bookmark your blog post . You actually have good posts. Regards for sharing with us your blog site.

]]>
Comment on Handling a GDI Resource Leak by Rachelle Marbry https://codingsight.com/gdi-leak-handling/#comment-291 Wed, 15 Sep 2021 22:31:47 +0000 http://codingsight.com/?p=335#comment-291 I was able to find good information from your blog articles.

]]>
Comment on Centralized Data Modeling Using Power BI Templates by Louise Cersey https://codingsight.com/centralized-data-modeling-using-power-bi-templates/#comment-473 Wed, 15 Sep 2021 18:38:37 +0000 http://codingsight.com/?p=13349#comment-473 Hello! I’ve been following your website for a while now and finally got the courage to go ahead and give you a shout out from Porter Texas! Just wanted to tell you keep up the good job!|

]]>
Comment on Introduction to Synonyms in SQL Server by Janna Riviere https://codingsight.com/synonyms-in-sql-server-an-overview/#comment-481 Wed, 15 Sep 2021 15:32:06 +0000 http://codingsight.com/?p=14372#comment-481 I think other site proprietors should take this web site as an model, very clean and great user friendly style and design, as well as the content. You’re an expert in this topic!

]]>
Comment on T-SQL BEST Practices by Lynn Pettis https://codingsight.com/t-sql-best-practices/#comment-331 Wed, 15 Sep 2021 15:11:51 +0000 http://codingsight.com/?p=3368#comment-331 Your tips are good. There are couple of issues with two of them, however, that should be addressed.

Avoid correlated subqueries.

This query:

SELECT
p.Name AS ProductName
, (SELECT pc.Name
FROM Production.ProdutCategory AS pc
WHERE pc.ProductCategoryID = p.ProductSubcategoryID
) AS ModelName
FROM
Prodution.Product AS p;

May not be equvilent to this query:

SELECT
p.Name AS ProducctName
, pc.Name AS ModelName
FROM
Prodution.Product AS p
LEFT JOIN Prodution.ProductCategory AS pc — Left inner join from Product to ProductCategory
ON pc.ProductCategoryID = p.ProductSubcategoryID;

The first query could have NULL values returned by the subquery. This would not be
the case it there was a foreign key relationship between Product and ProductCategory
where the values in ProductSubcategoryID must exist in ProductCategoryID.

If NULL values are possible, then the new query would need to look like this:

SELECT
p.Name AS ProducctName
, pc.Name AS ModelName
FROM
Prodution.Product AS p
LEFT OUTER JOIN Prodution.ProductCategory AS pc
ON pc.ProductCategoryID = p.ProductSubcategoryID;

Use small batcches in delete an upddate statements.

The original script in the article will work when being run manually in SSMS.
However, if you are writing a procedure, the code provided won’t work.
You will need something like this:

DECLARE @BatchSize int
, @LoopSize int
, @LoopCnt int;

SET @BatchSize = 1000;
SET @LoopSize = CEILING((1.0 * (SELECT COUNT(*)
FROM Sales.SalesOrderDetail AS sod
WHERE sod.CarrierTrackingNumber IS NULL
)
) / @BatchSize
);
SET @LoopCnt = 0;
WHILE @LoopCnt < @LoopSize
BEGIN
BEGIN TRAN
UPDATE TOP(@BatchSize) Sales.SalesOrderDetail SET
CarrierTrackingNumber = 'NewNumber_01'
WHERE CarrierTrackingNumber IS NULL;
COMMIT TRAN;
SET @LoopCnt += 1;
END;

]]>
Comment on How to Use AWS Secrets Manager: Tutorial & Examples by epoxy flooring services Sydney https://codingsight.com/the-aws-secrets-manager/#comment-503 Wed, 15 Sep 2021 14:22:13 +0000 http://codingsight.com/?p=16164#comment-503 I do not even know how I ended up here, but I thought this post was good. I don’t know who you are but certainly you’re going to a famous blogger if you aren’t already ? Cheers!

]]>
Comment on 3 Nasty I/O Statistics That Lag SQL Query Performance by https://topphimhot.net https://codingsight.com/3-nasty-i-o-statistics-that-lag-sql-query-performance/#comment-425 Wed, 15 Sep 2021 13:35:23 +0000 https://codingsight.com/?p=10000#comment-425 Best view i have ever seen !

]]>
Comment on How to Use AWS Secrets Manager: Tutorial & Examples by Francesco Heidelberg https://codingsight.com/the-aws-secrets-manager/#comment-502 Wed, 15 Sep 2021 08:10:56 +0000 http://codingsight.com/?p=16164#comment-502 cheers.

]]>
Comment on What is a Materialized View and Why Should you Use It? by Fashion Styles https://codingsight.com/sql-server-materialized-view-and-why-should-you-use-it/#comment-488 Wed, 15 Sep 2021 04:34:50 +0000 http://codingsight.com/?p=14948#comment-488 I have been exploring for a little bit for any high quality articles or blog posts on this kind of area . Exploring in Yahoo I at last stumbled upon this website. Reading this information So i抦 happy to convey that I’ve a very good uncanny feeling I discovered exactly what I needed. I most certainly will make certain to don抰 forget this site and give it a look regularly.

]]>
Comment on Grouping Data using the OVER and PARTITION BY Functions by Calculating SQL Running Total with OVER and PARTITION BY Clauses https://codingsight.com/grouping-data-using-the-over-and-partition-by-functions/#comment-327 Tue, 14 Sep 2021 13:13:41 +0000 http://codingsight.com/?p=3352#comment-327 […] Grouping Data using the OVER and PARTITION BY Functions […]

]]>