Additional Articles


Technical Article

SQLClean 2.0 Released

SQLClean is a SQL Tool that automatically creates a dependancy analysis of your SQL Server Database including tables, views, triggers, defaults, procedures etc. SQLClean will also analyze a client application for depenandies on SQL Objects allowing you to detect and eliminate unused SQL objects that are unreferenced by either the client app. or database itself.

2002-07-26

3,537 reads

Technical Article

In the Trenches: Getting the Most Out of SQL Server

This e-seminar will discuss how Quest's performance diagnostic solutions for SQL Server can help you get the most out of your database. Learn, through real-world scenarios, how to increase database performance and ensure optimal availability of your SQL Server environment. This free e-seminar will teach you how to:

* Proactively diagnose and resolve bottlenecks
* Ensure high levels of performance and availability
* Maintain SLAs

2002-07-10

273 reads

Blogs

SQL Server Performance – What IT Leaders Need to Know

By

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

FREE Window Functions Course (This Month Only!)

By

Want to really level up your SQL game? I mean, go from good to great? This March...

Tally Table Alternatives: #SQLNewBlogger

By

We published an article recently at SQL Server Central on Tally Tables in Fabric...

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