Piping a Query to a Text File
The case where one has to send the results of a query to a text file comes up quite often. This quick tip will show you how to output the results of a query to a text file.
2001-05-21
11,934 reads
The case where one has to send the results of a query to a text file comes up quite often. This quick tip will show you how to output the results of a query to a text file.
2001-05-21
11,934 reads
The CASE statement is a very flexible tool. Here are just a few of the tricks you can work with it.
2001-05-15
14,805 reads
Ever have duplicate rows of data returned in a query? This article by Neil Boyle examines different techniques for removing duplicate rows.
2001-05-14
11,794 reads
Need to rough up some bulk test data in a hurry? A carefully thought-out Cross Join could be the answer.
2001-05-10
6,465 reads
The third part of Steve Jones's series on programming and manipulating strings in T-SQL dealing with REPLACE.
2001-04-18
17,128 reads
The fourth part of Steve Jones's series on programming and manipulating strings in T-SQL dealing with numeric conversions.
2001-04-18
9,521 reads
By Kevin3NF
IT leaders have a lot on their plates! Budgets, staffing, security, uptime, and keeping...
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...
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