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

Explain cursor as data base object?

0 Answers  


How many types of dimensions are there and what are they? : sql server analysis services, ssas

0 Answers  


What happens if you insert a duplicate key for the primary key column in ms sql server?

0 Answers  


how to create a scrollable cursor with the scroll option? : Sql server database administration

0 Answers  


What is database dimension? : sql server analysis services, ssas

0 Answers  






You want to implement the one-to-many relationship while designing tables. How would you do it?

0 Answers  


What is the maximum size of column in sql server?

0 Answers  


What is system stored procedures?

0 Answers  


How to write an inner join with the where clause in ms sql server?

0 Answers  


Explain indexed view?

1 Answers  


what are different types of raid configurations? : Sql server database administration

0 Answers  


there is a table having two columns no and name and the data is 1 A 2 B 3 C write a query that will result a horizontal output A,B,C

9 Answers   tdfc, vsworx,


Categories