Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 do I start sql server 2016?

0 Answers  


What are the events recorded in a transaction log?

0 Answers  


What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?

0 Answers   Accenture,


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

0 Answers  


Explain the flow of creating a cube? : sql server analysis services, ssas

0 Answers  


What is sql server locking?

0 Answers  


What is unique key constraint?

0 Answers  


if no size is defined while creating the database, what size will the database have? : Sql server administration

0 Answers  


What new changes are being made in SQL Server?

0 Answers   Blue Star,


What is co-related sub query?

0 Answers  


How to get a list of all tables with "sys.tables" view in ms sql server?

0 Answers  


What is primary key, unique key, and foreign key?

0 Answers  


Categories