In this article, I will explain some general SQL Server “Queries”. I think most of each developer wants to write a query to PRINT “Happy New Year” and sent to developers and team for their BEST WISHES.
Due to this, I am tried to write a “SQL Query” and sharing with you! If you have any other smart query related to this (You can share to me and I will re-publish this post with your query!)
The Query Example As,
-- Simple Query SELECT CAST(0X4861707079204E65772079656172 AS VARCHAR(100)) AS 'Result' -- OR -- Some Stylish Query SELECT SPACE(TOTAL - LEN(REPLICATE(CHAR(CHARACTERS), NO))) + REPLICATE(CHAR(CHARACTERS), NO * 2-1) as 'HappyNewYear' FROM ( SELECT TOP 5 ROW_NUMBER() OVER (ORDER BY name) AS NO, 15 AS total, 214 AS CHARACTERS FROM sysobjects ) AS T UNION ALL SELECT SPACE(10) + CAST(0X4861707079204E65772079656172 AS VARCHAR(100))
Results :-
Happy New year
Ö ÖÖÖ ÖÖÖÖÖ ÖÖÖÖÖÖÖ ÖÖÖÖÖÖÖÖÖ Happy New year