Lighter side of a TSQL query :: Wedding Style

Published 09 August 08 09:45 AM | SQL Master 

Writing a better TSQL query will get you better performance, in terms of system & life-style too.

Here is the email I received from my BIL, too get a     lighter side of blending a TSQL query as Stored Procedure (from а BrideGroom) .... guess what would be end result of that Stored Procedure!!  

----------------

Connect to MarriageLookings SQL instance and write the following Stored Procedure to execute:

 

CREATE PROCEDURE BeforeMarriage (BrideGroom Male (25) ,Bride Female(20) )

AS
BEGIN

    SELECT Bride FROM  [india_Brides] WHERE FatherInLaw = 'Millionaire' 
    AND  Count(Car) > 20  

    AND  HouseStatus ='ThreeStoreyed'

    AND BrideEduStatus IN ('Masters Degree','B.TECH' ,'B.E' ,'Degree' ,'MCA' ,'MiBA')

    AND Having  Brothers= Null AND Sisters =Null
 
END

GO

CREATE PROCEDURE AfterMarriage (FatherInLawBankAccount(25) , MyBankAccount(20) )

AS
BEGIN
 

    SELECT Gold ,Cash,Car,BankBalance FROM FatherInLaw   

    UPDATE MyBankAccout SETMyBal = MyBal + FatherInLawBal

    UPDATE MyLocker SET MyLockerContents = MyLockerContents + FatherInLawGold


    INSERT INTO MyCarShed VALUES('BMW')
END
GO 

----------------------------------------------------------------------

Compiled both the stored procedures and executed, awaiting results!!!

!

!

!

!

!

!

!

!

!

!

!

!

!

Then the BrideGroom writes the below query as a reply:

DROP BrideGroom;
Commit; 


Hope you get the lighter side of the above TSQL query. 

 

 

Comments

# SQL Server Transact-SQL (SSQA.net) : Lighter side of a TSQL query :: Wedding Style said on August 9, 2008 9:51 AM:

PingBack from http://sqlserver-qa.net/blogs/t-sql/archive/2008/08/09/4755.aspx

# Other SQL Server Blogs around the Web said on August 9, 2008 11:18 AM:

Writing a better TSQL query will get you better performance, in terms of system & life-style too

Anonymous comments are disabled

About SQL Master

**__________________________________** SQL Server MVP, Sr. DBA & industry expert. - Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it. It is also a power and you will gain by sharing it.

Search

Go

This Blog

«August 2008»
SMTWTFS
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

Syndication