[personal profile] finesoul

Sql script:

SET SHOWPLAN_TEXT ON
go

select *
from Dealer d
 inner join AccountNumber an
 on d.AccountNumberID = an.ID
where an.AccountNumber='12345678'
and d.StartDate <= GETDATE()
and d.EndDate>=GETDATE()

It's output (Execution mode "results to text")
StmtText
-------------------------

SET SHOWPLAN_TEXT ON

(1 row(s) affected)

StmtText
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

select *
from Dealer d
 inner join AccountNumber an
 on d.AccountNumberID = an.ID
where an.AccountNumber='12345678'
and d.StartDate <= GETDATE()
and d.EndDate>=GETDATE()

(1 row(s) affected)

StmtText
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |--Nested Loops(Inner Join, OUTER REFERENCES:([d].[ID]))
       |--Nested Loops(Inner Join, OUTER REFERENCES:([an].[ID]))
       |    |--Nested Loops(Inner Join, OUTER REFERENCES:([an].[ID]))
       |    |    |--Index Seek(OBJECT:([SCSSDev].[dbo].[AccountNumber].[UX_AccountNumber] AS [an]), SEEK:([an].[AccountNumber]=N'12345678') ORDERED FORWARD)
       |    |    |--Clustered Index Seek(OBJECT:([SCSSDev].[dbo].[AccountNumber].[PK_AccountNumber] AS [an]), SEEK:([an].[ID]=[SCSSDev].[dbo].[AccountNumber].[ID] as [an].[ID]) LOOKUP ORDERED FORWARD)
       |    |--Index Seek(OBJECT:([SCSSDev].[dbo].[Dealer].[UX_Dealer] AS [d]), SEEK:([d].[AccountNumberID]=[SCSSDev].[dbo].[AccountNumber].[ID] as [an].[ID] AND [d].[StartDate] <= getdate()) ORDERED FORWARD)
       |--Clustered Index Seek(OBJECT:([SCSSDev].[dbo].[Dealer].[PK_Shop] AS [d]), SEEK:([d].[ID]=[SCSSDev].[dbo].[Dealer].[ID] as [d].[ID]),  WHERE:([SCSSDev].[dbo].[Dealer].[EndDate] as [d].[EndDate]>=getdate()) LOOKUP ORDERED FORWARD)

(7 row(s) affected)



If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Лютий 2022

Н П В С Ч П С
  12345
6789101112
13141516171819
202122232425 26
2728     

За стиль дякую

Створено з Dreamwidth Studios
Сторінка створена 2026-Лют-13, П'ятниця 12:12