Joyeux Noel 2011

Un petit script pour vous souhaiter un joyeux Noel :)



SET NOCOUNT ON;

——————————

CREATE TABLE #JOYEUX_NOEL
(
col1 CHAR(290)
);

INSERT #JOYEUX_NOEL VALUES (REPLICATE(CHAR(111), 12));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1), 50, SPACE(2) + REPLICATE(CHAR(42), 14));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(4) + CHAR(44) + CHAR(45) + CHAR(46) + SPACE(5) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(3) + CHAR(40) + CHAR(41) + SPACE(2) + CHAR(92) + SPACE(4) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(2) + CHAR(95) + CHAR(47) + REPLICATE(CHAR(95), 4) + CHAR(92) + CHAR(95) + SPACE(2) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(1) + CHAR(40) + REPLICATE(CHAR(95), 8) + CHAR(41) + SPACE(1) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(1) + CHAR(40) + CHAR(47) + SPACE(1) + CHAR(64) + SPACE(2) + CHAR(64) + SPACE(1) + CHAR(92) + CHAR(41) + SPACE(1) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(1) + CHAR(40) + CHAR(96) + CHAR(44) + SPACE(1) + CHAR(40) + CHAR(41) + CHAR(46) + + CHAR(44) + CHAR(39) + CHAR(41) + SPACE(1) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(1) + CHAR(40) + SPACE(1) + CHAR(96) + CHAR(45) + CHAR(39) + CHAR(96) + CHAR(45) + CHAR(39) + SPACE(1) + CHAR(41) + SPACE(1) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(2) + CHAR(92) + REPLICATE(CHAR(44), 6) + CHAR(47) + SPACE(2) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + REPLICATE(CHAR(42), 14));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(3) + CHAR(74) + CHAR(79) + CHAR(89) + CHAR(69) + CHAR(85) + CHAR(88) + SPACE(3) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + CHAR(42) + SPACE(4) + CHAR(78) + CHAR(79) + CHAR(69) + CHAR(76) + SPACE(4) + CHAR(42));
UPDATE #JOYEUX_NOEL SET col1 = STUFF(col1, LEN(col1)+ 1, 50, SPACE(2) + REPLICATE(CHAR(42), 14));

——————————

DECLARE @SQL VARCHAR(100);

DECLARE @DBCC_IND TABLE
(
PageFID INT,
PagePID INT NULL,
IAMFID INT NULL,
IAMPID INT NULL,
ObjectID BIGINT,
IndexID INT,
PartitionNumber INT,
PartitionID BIGINT,
iam_chain_type VARCHAR(50),
PageType INT,
IndexLevel TINYINT NULL,
NextPageFID INT,
NextPagePID INT,
PrevPageFID INT,
PrevPagePID INT
);

INSERT @DBCC_IND
EXEC(‘DBCC IND( »tempdb »,  »#JOYEUX_NOEL », 0)’);

SELECT @sql = ‘DBCC TRACEON(3604); DBCC PAGE ( »tempdb », 1, ‘ + CAST(PagePID AS VARCHAR(20)) + ‘, 1)’
FROM @DBCC_IND
WHERE PageType = 1;

EXEC(@sql);

Enjoy !!

David BARBARIN (Mikedavem)
MVP SQL Server

2 réflexions au sujet de « Joyeux Noel 2011 »

Laisser un commentaire