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 the use of for clause?

0 Answers  


How to turn on the mssql api module in php?

0 Answers  


Write an SQL query if u want to select the data from one block which intern reflects in another block ? thanx,do reply

1 Answers   Covansys,


Explain what is scheduled job and how to create it?

0 Answers  


Does hive support indexing?

0 Answers  


how to delete duplicate rows in sql server2005

7 Answers   Cisco, CTS, HCL, IBM,


How to use subqueries with the exists operators in ms sql server?

0 Answers  


What are the difficulties faced in cube development? : sql server analysis services, ssas

0 Answers  


What does select 1 mean?

0 Answers  


Explain nested trigger in sql?

0 Answers  


What is use of attribute hierarchy ordered ? : sql server analysis services, ssas

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,


Categories