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 to find the date and time of last updated table?

6 Answers   Teledata,


What do you understand by recursive stored procedure?

0 Answers  


Explain the difference between functions and stored procedures in sql server?

0 Answers  


What is the bookmark lookup and rid lookup?

0 Answers  


How reterive duplicate value in SQL?

6 Answers  






How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?

0 Answers  


What are transactions and its controls?

0 Answers  


Which are ddl commands?

0 Answers  


What's the difference between a primary key and a unique key?

4 Answers  


Can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible?

0 Answers  


1. How to fetch all the duplicate records from the table. 2. How to fetch the second highest salary from the table.

12 Answers   Accenture,


What is extended stored procedures?

0 Answers  


Categories