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"

Answers were Sorted based on User's Feedback



There is table like Events...in that name ,startdate ,enddate,location are the column names write..

Answer / 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

There is table like Events...in that name ,startdate ,enddate,location are the column names write..

Answer / krishna mohan thamisetty

select datename(mm, startdate) startdate, datename(mm,
enddate) enddate, location from t1

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL Server Interview Questions

How you provide security to cube? : sql server analysis services, ssas

0 Answers  


What is clustered vs nonclustered index?

0 Answers  


Disadvantages of the indexes?

0 Answers  


Explain different types of lock modes in sql server 2000?

0 Answers  


What is Outter Join?

1 Answers  






Explain how to use linked server?

0 Answers  


Does hive support indexing?

0 Answers  


How to manipulate data from one table to another table ?

0 Answers   MCN Solutions,


wat new abt truncate in sql server

2 Answers   HCL, HP,


What is the contrast between sql and pl/sql?

0 Answers  


Explain the etl (extraction, transformation, and loading)?

0 Answers  


Explain about service Broker functions?

0 Answers  


Categories