RSSAmplifier

Blog

Andy M Mallon – AM²

Databases Diversity — Checking Integrity

am2.coRSS feed ↗10 posts

Latest posts

Consuming SQL Agent dates & durations

SQL Agent s schema is older than me. It handles dates, times, and durations like it s 1980 by using integers instead of date/time data types. My buddy Aaron Bertrand talks more about Dating Responsibly so that you can have a good datetime with your own database. ... [Read More] The post Consuming SQL Agent dates durations appeared first on Andy M Mallon - AM² .

Migrating my Stack Overflow answers to blog posts (Sorry for the spam)

For a while, I have been thinking about using my Stack Overflow answers (and answers on other sites on the Stack Exchange Network), and storing a copy of them here, on my blog as well. All posts on the Stack Exchange network are covered under ... [Read More] The post Migrating my Stack Overflow answers to blog posts (Sorry for the spam) appeared first on Andy M Mallon - AM² .

Not all stats should be auto-updated

Statistics auto-updates are generally a good thing auto-update of statistics is the default behavior in SQL Server. Having the freshest information about the data shape helps to inform the best selection of an execution plan for queries. Except for when it doesn t. Because It Depends™️ Let s ... [Read More] The post Not all stats should be auto-updated appeared first on Andy M Mallon - AM² .

T-SQL Tuesday: The last ticket I closed

For this month s T-SQL Tuesday, Brent Ozar (blog Instagram) asks us to describe the most recent ticket we closed. We had a pretty significant wait spike The literal last ticket I closed was please run this script in production , and I don t think it would be ... [Read More] The post T-SQL Tuesday: The last ticket I closed appeared first on Andy M Mallon - AM² .

Enforce a specific constraint to be checked first?

Question I have the following SQL Server table : create table Account( -- column names with their data types and properties Id int not null identity primary key, User varchar(50) not null, Job varchar(200) not null, -- table limitations constraint UniqueUserPerAccount unique (User), constraint UniqueJobPerAccount ... [Read More] The post Enforce a specific constraint to be checked first? appeared…

AG secondary is out of sync for hours after index maintenance

Question We have a 3TB OLTP database running Siemens Opcenter MES software at one of our manufacturing plants in China. This is setup in an Always-On Availability group with one secondary node. As this is a manufacturing plant, we are only provided 11 1/2 hours ... [Read More] The post AG secondary is out of sync for hours after index maintenance appeared first on Andy M Mallon - AM² .

Using OPENJSON, can’t get results to GROUP BY

Question I m passing a JSON string to a stored procedure in order to insert warehouse inventory. Sometimes, there will be multiple line items with the same product, going to the same shelf, on the same pallet (LPN), with the same date. I would like to ... [Read More] The post Using OPENJSON, can t get results to GROUP BY appeared first on Andy M Mallon - AM² .

SQL Modulo Function gives the wrong value?

Question In Javascript, Excel, Python, and a scientific calculator, the modulo operation -34086.1576962834 % 360.0 lt;-- python =MOD(-34086.1576962834, 360.0) lt;-- Excel function gives a value of 113.84230371659942. (Or something very close to that, depending on number of decimal places and rounding.) But in T-SQL, Select ... [Read More] The post SQL Modulo Function gives the wrong value?…

Is SQL Server affected by OpenSSL 3.0 Vulnerabilities: CVE 2022-3786 and CVE 2022-3602

Question I am trying to establish whether SQL Server is affected by the recently discovered OpenSSL vulnerabilities. For example, are SQL Servers that are using TLS/Certificates to encrypt connections between client and server affected to? I believe SQL Server uses Open SSL libraries for encryption ... [Read More] The post Is SQL Server affected by OpenSSL 3.0 Vulnerabilities: CVE 2022-3786 and…

What’s the use case of disabling an index?

Question I just learned that indexes can be disabled on a table. Even the clustered index can be disabled. After that, users can t access the index or the data if clustered index. When will we disable an index? I just don t understand the use case. ... [Read More] The post What s the use case of disabling an index? appeared first on Andy M Mallon - AM² .