Site Owners

SQLServerCentral.com site owners.


External Article

Five Things (We Bet) You Didn't Know About Subversion Webinar - Rescheduled for November 8th

Rescheduled for November 8th, 2011 9:00 AM - 10:00 AM PST
Come and learn The Truth about Migration to and Administration for Apache Subversion. CollabNet, Subversion founder and corporate sponsor, and Red Gate Software, number one in SQL source management using any SCM system, want to share five powerful truths about Subversion that will fortify your decision to leave VSS behind.

If you were registered for the original event, please re-register for the new date.

2011-11-04 (first published: )

3,291 reads

Blogs

Save Azure PostgreSQL Backup to Storage

By

This may or may not be helpful in the long term, but since I’m...

The Book of Redgate: What’s Great about Redgate?

By

“I’m sick of hearing about Red Gate.” The first article in the book has...

SQL Server Performance – What IT Leaders Need to Know

By

IT leaders have a lot on their plates! Budgets, staffing, security, uptime, and keeping...

Read the latest Blogs

Forums

Dynamic T-SQL Script Parameterization Using Python

By omu

Comments posted to this topic are about the item Dynamic T-SQL Script Parameterization Using...

Multiple Sequences

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Multiple Sequences

Using SQL Server Stored Procedures with the Django ORM

By omu

Comments posted to this topic are about the item Using SQL Server Stored Procedures...

Visit the forum

Question of the Day

Multiple Sequences

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 nms
Assume the dbo.MonthSales table exists. If I run this, what happens?

See possible answers