SSMS explain plan sometimes shows prepared (parameterized) statement in the execution plan header

Copper Contributor

hi all, merry xmas!

Question for you. Why is it that sometimes when I run a query, the execution plan header section in SSMS sometimes shows the query as parameterized and sometimes it doesn't? For example, when I run the following query, the execution plan header section shows the statement just like shown below.

select * from testdt where col1 = getdate()

 

However, if I modify the where clause slightly, like the following

select * from testdt where col1 = getdate() - 3

 

The execution plan statement shows as follows

SELECT * FROM [testdt] WHERE [col1]=(getdate()-@1)

0 Replies