Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

There is table like Events...in that name ,startdate
,enddate,location are the column names
write a stored Procedure for this table to get events by
Months "GetEventsByMonths"

Answer Posted / newbie

CREATE PROCEDURE GetEventsByMonths
@MONTH VARCHAR(15)
AS

SET NOCOUNT ON

SELECT name,DATENAME(MONTH,startdate) AS Startmonth
FROM Events
WHERE DATENAME(MONTH,startdate) = @MONTH
GROUP BY name,DATENAME(MONTH,startdate)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to throw custom exception in Stored Procedure?

1006


Explain the usage of floor function in sql server.

928


What are the results of running this script?

880


What is shrink log file?

859


How many types of relations are there between dimension and measure group? : sql server analysis services, ssas

1166


Does view occupy space?

894


What is an etl file?

916


Describe in brief authentication modes in sql server.

987


what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration

981


What is partition in sql server?

992


Explain sql server service broker?

941


Can we add our custom code in ssis?

960


What is a recursive stored procedure in sql server?

1115


What are the diifferences between the ms sql server vs mysql?

1139


Difference between group by clause and having clause in SQL?

941