Saturday, December 23, 2017

IF / Else IF Condition in MSSQL

IF / Else IF Condition in MSSQL


-- HOW TO USE IF / ELSE IF CONDITION IN SQL

DECLARE @ColorCode Int 

SET @ColorCode = 2

IF (@ColorCode = 1)
BEGIN
 SELECT 'RED' AS ColorName
END
IF (@ColorCode = 2)
BEGIN
 SELECT 'GREEN' AS ColorName
END
IF (@ColorCode = 3)
BEGIN
 SELECT 'BLUE' AS ColorName
END



Thursday, December 21, 2017

How to change Schema Name in SQL

Below Query for change you table schema name from eg. dbo. to test.

ALTER SCHEMA YourSchemaName TRANSFER dbo.YourTableName

-- it will change your schema name from "dbo" to "YourSchemaName"

How to create KBC game in c# desktop application

Source Code

Click here Download KBC Game Source Code

Exe

Click here Download KB Game exe


First Create One Form like forma name is Dashboard.

Then Drag and Drop control and design form.see image Dashboard design layout.


See Out-Put in KBC Game:


1) Audience Poll Screen short :




2) KBC Game Use 50-50 Option



3) KBC Game your answer is wrong then display You Lose Game See Image


4) KBC Game Your all Answer is Currect then you are win see display image











How to get TOP n Records from Azure document DB

How to get TOP n Records from Azure document DB

=>

           Query : SELECT TOP 1 * FROM c

            Result : Your Database Record


How to get record count in Azure DocumentDb (Microsoft Document DB)

How to get record count from cosmos DB (Microsoft Document DB)


=>    Query : SELECT COUNT(1) FROM c  WHERE c.City = "A"

         Result : [  {  "$1": 15 } ]