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

Describe and explain about SQL native client?

614


What is the most common type of join?

525


Why is there a performance difference between two similar queries where one uses union and the other uses union all?

508


what is a self join? : Sql server database administration

522


What are different types of replication in sql server?

568






What is the difference between inner join and equi join?

490


You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?

543


What are the limitations/drawbacks or ssrs 2008 r2?

86


what are the different ways to return the rowcount of a table?

572


What is instead of dml trigger?

584


What the class forname () does?

538


What are key, name and value columns of an attribute? : sql server analysis services, ssas

570


What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

593


What is shared lock?

487


How to enter unicode character string literals in ms sql server?

571