Best SQL Query for Happy New Year [SQL Query]

Best SQL Query for Happy New Year [SQL Query]

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
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

www.code-sample.com/. Powered by Blogger.
^