2025-03-12 (first published: 2018-10-19)
965 reads
2025-03-12 (first published: 2018-10-19)
965 reads
2025-03-12
281 reads
We published an article recently at SQL Server Central on Tally Tables in Fabric from John Miner. In it he showed how this can be efficient. A day after...
2025-03-12
11 reads
This month’s T-SQL Tuesday blog party is hosted by Deborah Melkin, and it’s a good one that asks us where we are making the world better. The topic is...
2025-03-11
3 reads
2025-03-10
320 reads
The ways in which you might try and reverse engineer a database design are on Steve's mind today.
2025-03-10 (first published: 2018-11-30)
228 reads
One interesting concept in SQL Server is Deferred Name Resolution. This is something many developers struggle with understanding how this works and where it works. In the Microsoft docs,...
2025-03-10 (first published: 2025-03-03)
345 reads
How are you navigating the database landscape? Our latest report sheds light on the current state of database management and offers valuable insights into how organizations can navigate and simplify the growing complexities of the database landscape.
2025-03-10
waldosia– n. a condition in which you keep scanning faces in a crowd looking for a specific person who would have no reason to be there, as if your...
2025-03-07
5 reads
2025-03-07
332 reads
Want to really level up your SQL game? I mean, go from good to great? This March...
By Steve Jones
We published an article recently at SQL Server Central on Tally Tables in Fabric...
By James Serra
In today’s data-driven world, organizations need the ability to analyze and act on data...
Comments posted to this topic are about the item Dynamic T-SQL Script Parameterization Using...
The state-of-the-art FARE Labs Environmental Testing Laboratory provides a comprehensive variety of testing services...
I'm running some restoration activity as part of a rehearsal to prepare for an...
I created a new sequence in SQL Server 2022 with this code.
CREATE SEQUENCE myseqtest START WITH 1 INCREMENT BY 1; GOI want to use this to insert some data from another table into a new table with this sequence. Which of these queries shows the way to do this efficiently?
-- 1 INSERT dbo.NewMonthSales (SaleID, saleyear, salemonth, currSales) SELECT NEXT VALUE FOR myseqtest , ms.saleyear , ms.salemonth , ms.currMonthSales FROM dbo.MonthSales AS ms; GO -- 2 INSERT dbo.NewMonthSales (SaleID, saleyear, salemonth, currSales) SELECT NEXT VALUE , ms.saleyear , ms.salemonth , ms.currMonthSales FROM dbo.MonthSales AS ms, myseqtest; GO --3 DECLARE mycurs CURSOR FOR SELECT ms.saleyear , ms.salemonth , ms.currMonthSales FROM dbo.MonthSales AS ms DECLARE @yr INT, @mn INT, @sales NUMERIC(10,2) FETCH NEXT FROM mycurs INTO @yr, @mn, @sales WHILE @@FETCH_STATUS = 0 BEGIN INSERT dbo.NewMonthSales (SaleID, saleyear, salemonth, currSales) SELECT NEXT VALUE FOR myseqtest , @yr , @mn , @sales FETCH NEXT FROM mycurs INTO @yr, @mn, @sales ENDSee possible answers