Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare @tab1 table (typ int, numer int)
- declare @typMain int
- declare @numerMain int
- set @typMain = 2042
- set @numerMain = 4659667
- declare @typ int
- declare @numer int
- select @typ = TrN_ZwrTyp, @numer = TrN_ZwrNumer from cdn.Tranag WHERE TrN_GIDTyp = @typMain and TrN_GIDNumer = @numerMain
- INSERT INTO @tab1 VALUES(@typMain, @numerMain)
- WHile (NOT ((@typ =@typMain) AND (@numer=@numerMain)) ) AND (@typ <> 0)
- begin
- insert INTO @tab1 VALUES(@typ, @numer)
- Select @typ = TrN_ZwrTyp, @numer = TrN_ZwrNumer from cdn.TraNag Where TrN_GIDTyp = @typ AND TrN_GIDNumer = @numer
- End
- select * from @tab1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement