This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAISERROR ('Test', 0, 1) WITH NOWAIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE dbo.Department | |
SET DeptName = 'Sales and Marketing' | |
UPDATE dbo.Manager | |
SET ManagerName = 'Greg Dodd' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE Department | |
( | |
DeptID INT NOT NULL PRIMARY KEY CLUSTERED | |
,DeptName VARCHAR(50) NOT NULL | |
,ManagerID INT NULL | |
,SysStartTime DATETIME2 GENERATED ALWAYS AS ROW START NOT NULL | |
,SysEndTime DATETIME2 GENERATED ALWAYS AS ROW END NOT NULL | |
,PERIOD FOR SYSTEM_TIME(SysStartTime, SysEndTime) | |
) | |
WITH (SYSTEM_VERSIONING = ON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER DATABASE StackOverflow | |
SET READ_COMMITTED_SNAPSHOT ON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXEC sp_blitzwho @ExpertMode = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH AggregateData AS | |
( | |
SELECT Gate | |
,MAX(RecordedTime) AS MaxRecordedTime | |
FROM dbo.SFOGateInfo | |
) | |
UPDATE AggregateTest | |
SET LastUsedDateTime = AggregateData.MaxRecordedTime | |
FROM AggregateTest | |
INNER JOIN AggregateData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO AggregateTest (Gate, LastUsedDateTime) | |
SELECT Gate | |
MAX(RecordedTime) | |
FROM SFOGateInfo | |
GROUP BY Gate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE AggregateTest | |
SET LastUsedDateTime = MAX(recordedTime) | |
FROM SFOGateInfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE AggregateTest | |
( | |
ID INT IDENTITY(1, 1) PRIMARY KEY NOT NULL | |
,Gate VARCHAR(5) NULL | |
,LastUsedDateTime DATETIME2(7) NULL | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DBCC TRACEON(460) |
NewerOlder