T-SQL Advice For Young, Old, and even Eccentric
Be mindful of advice. Give an ear to those offering it. Just be mindful, there is no need to accept the advice, but it is wise to at least...
2022-04-22 (first published: 2022-04-12)
836 reads
Be mindful of advice. Give an ear to those offering it. Just be mindful, there is no need to accept the advice, but it is wise to at least...
2022-04-22 (first published: 2022-04-12)
836 reads
Checkpoints are essential in SQL Server to help with the durability and reliability of data persisted in the database. When done right, you barely even notice them and performance...
2022-02-02 (first published: 2022-01-14)
497 reads
Bulk insert can be an extremely helpful tool to help ingest data into SQL Server efficiently. Sometimes, it is necessary to capture metrics in regards to the bulk insert...
2022-01-24 (first published: 2022-01-07)
759 reads
Every Database has a DBO or database owner set. Sometimes the owner is invalid, while most of the time the DBO is perfectly normal. It is easy to ignore...
2022-01-17 (first published: 2022-01-05)
658 reads
Source control is quintessential to a productive development environment. A well maintained and organized source control system is akin to having known-good database backups. Having the right tools to...
2022-01-02
44 reads
This is a very simple introduction into the creation of an Extended Event session using a template for Azure SQL DB. I demonstrate the use of the GUI to...
2022-01-02
49 reads
Excessive memory grants are extremely problematic in SQL Server. These excessive grants do not just happen out of the blue. Memory grants are directly linked to the queries.
The post...
2022-01-01
94 reads
Having a Database Owner is not something that most people think about until something breaks. Usually, people will just kind of ignore it because it is just so innocuous...
2022-01-14 (first published: 2021-12-31)
340 reads
Excessive memory grants are extremely problematic in SQL Server. These excessive grants do not just happen out of the blue. Memory grants are directly linked to the queries.
The post...
2021-12-31
339 reads
Queries will fail. That is as inevitable as death and taxes. This article demonstrates how to find some truly horrible queries.
The post Queries that Fail and How to find...
2021-12-29
136 reads
This may or may not be helpful in the long term, but since I’m...
By Steve Jones
“I’m sick of hearing about Red Gate.” The first article in the book has...
By Kevin3NF
IT leaders have a lot on their plates! Budgets, staffing, security, uptime, and keeping...
Comments posted to this topic are about the item Dynamic T-SQL Script Parameterization Using...
Comments posted to this topic are about the item Multiple Sequences
Comments posted to this topic are about the item Using SQL Server Stored Procedures...
In SQL Server 2022, I run this code:
CREATE SEQUENCE myseqtest START WITH 1 INCREMENT BY 1; GO CREATE TABLE NewMonthSales (SaleID INT , SecondID int , saleyear INT , salemonth TINYINT , currSales NUMERIC(10, 2)); GO INSERT dbo.NewMonthSales (SaleID, SecondID, saleyear, salemonth, currSales) SELECT NEXT VALUE FOR myseqtest , NEXT VALUE FOR myseqtest , ms.saleyear , ms.salemonth , ms.currMonthSales FROM dbo.MonthSales AS ms; GO SELECT * FROM dbo.NewMonthSales AS nmsAssume the dbo.MonthSales table exists. If I run this, what happens? See possible answers