I am trying to write a stored proicedure that gets all the townID's from Region_TownPage table. Then i should get the City, Stateinitials of all the townID's.
Alter PROCEDURE [dbo].[GetTownDetailsforRegionID]
@RegionID int
AS
BEGIN
Declare @townID int
set @townID = (Select townID from Region_TownPage where regionID =@RegionID)
SET NOCOUNT ON;
Select City, StateInitials,TownID from TownPage where TownID =@townID
END
I do not know how to use an array here in sql. If someone could help me doing this, i really appreciate that.
Thanks in advance!!