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

What is difference between index and primary key?

0 Answers  


How to get a list of columns using the "sys.columns" view in ms sql server?

0 Answers  


Which virtual table does a trigger use?

8 Answers   TCS,


What is dbcc updateusage?

0 Answers  


What is the distinction amongst delete and truncate?

0 Answers  


how can u get last observation in an unknown dataset ?

0 Answers   Genpact,


What is the appropriate number of test cases that you can write on a database?

2 Answers   Microsoft,


What are the system database in sql server 2005?

0 Answers  


Explain activity monitors

0 Answers  


What are the aggregate and scalar functions?

0 Answers  


what is the difference between procedure and function.

4 Answers   Thomson,


Explain various On-Delete options in a DB table. Which is the default option?

0 Answers   Akamai Technologies,


Categories