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

What is forward - only cursors / read only cursor?

0 Answers  


What is merge?

0 Answers  


Explain linked server in sql?

0 Answers  


Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table?

5 Answers   eFunds,


What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?

0 Answers  






How to download microsoft sql server 2005 express edition?

0 Answers  


How do I run sql server 2014?

0 Answers  


What is stretch database in sql server?

0 Answers  


How to drop an existing table?

0 Answers  


What is a cube? : sql server analysis services, ssas

0 Answers  


When a primary key constraint is included in a table, what other constraints does this imply?

0 Answers  


How to insert multiple rows with one insert statement in ms sql server?

0 Answers  


Categories