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

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book