I have a Microsoft SQL Server R2 2008. And i see it first time in my life.
I have sql procedure:
DECLARE @RC int
DECLARE @Id uniqueidentifier
DECLARE @Segment_ID uniqueidentifier
DECLARE @SDate datetime
DECLARE @EDate datetime
DECLARE @withBig bit
DECLARE @withKm bit
DECLARE @withGeo bit
DECLARE @withDescr bit
-- TODO: задайте здесь значения параметров.
EXECUTE @RC = [Request_BusStation]
@Id
,@Segment_ID
,@SDate
,@EDate
,@withBig
,@withKm
,@withGeo
,@withDescr
GO
How i understand its just calling of procedure not thetself. But procedure too bit to copy it here.
AND have a table:
CREATE TABLE [BusStation](
[Id] [uniqueidentifier] NOT NULL,
[Segment_ID] [uniqueidentifier] NOT NULL,
[Dist] [decimal](18, 4) NOT NULL,
[Kod_Spr012] [smallint] NOT NULL,
[Square] [decimal](18, 6) NULL,
[OperationStartDate] [date] NULL,
[BallanceCost] [decimal](18, 6) NULL,
[DepreciatedCost] [decimal](18, 6) NULL,
[ChargesNorm] [decimal](18, 6) NULL,
[DocumentName] [varchar](100) NULL,
[DocumentNum] [varchar](100) NULL,
[DocumentDate] [date] NULL,
[Authority] [varchar](100) NULL,
[Kod_Spr091] [smallint] NOT NULL,
[HasWaysideStop] [bit] NOT NULL,
[HasLanding] [bit] NOT NULL,
[HasSpeedTransitArea] [bit] NOT NULL,
[LenSpeedTransitArea] [decimal](18, 6) NULL,
[YearBuilt] [smallint] NULL,
[YearMajorOverhaul] [smallint] NULL,
[Kod_Spr019] [smallint] NOT NULL,
[TechCond] [varbinary](max) NULL,
[LandCont] [varbinary](max) NULL,
[LandContDate] [date] NULL,
[LandContStartDate] [date] NULL,
[LandContEndDate] [date] NULL,
[Kod_Spr120] [smallint] NULL,
[E_Date_Begin] [datetime] NOT NULL,
[E_Date_End] [datetime] NULL,
[E_Date_Stop] [datetime] NULL,
Now i want to call this procedure for each row of table.
Its possible?
As mentioned in my comment, the only way I would know how to do that is using a
CURSOR. Here is some sample code (untested of course):This should help as well:
http://msdn.microsoft.com/en-us/library/ms180169.aspx
Good luck.