Commit 6d902ee
authored
Type plan_force_flat ids as bigint via TRY_CAST(LTRIM(...)) (#772)
The string-split path that parses sys.dm_db_tuning_recommendations.details
returns regressed_plan_id / recommended_plan_id with a leading space
because the upstream REPLACE chain inserts ': ' after every colon. The
implicit cast on insert into #tuning_recommendations was silently
swallowing the space; #771 added a TRY_CAST in the WHERE clause to
survive the same surface.
Move the type intent to the projection: TRY_CAST(LTRIM(SUBSTRING(...)) AS
bigint) so the columns leave the derived table already typed. Drops the
redundant TRY_CAST from the WHERE clause. Doesn't touch the splitting
math.1 parent 3a63bb6 commit 6d902ee
1 file changed
Lines changed: 31 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11082 | 11082 | | |
11083 | 11083 | | |
11084 | 11084 | | |
11085 | | - | |
| 11085 | + | |
11086 | 11086 | | |
11087 | | - | |
11088 | | - | |
11089 | | - | |
| 11087 | + | |
11090 | 11088 | | |
11091 | | - | |
11092 | | - | |
11093 | | - | |
11094 | | - | |
11095 | | - | |
| 11089 | + | |
| 11090 | + | |
| 11091 | + | |
| 11092 | + | |
| 11093 | + | |
| 11094 | + | |
| 11095 | + | |
| 11096 | + | |
| 11097 | + | |
| 11098 | + | |
| 11099 | + | |
| 11100 | + | |
| 11101 | + | |
11096 | 11102 | | |
11097 | 11103 | | |
11098 | | - | |
| 11104 | + | |
11099 | 11105 | | |
11100 | | - | |
11101 | | - | |
11102 | | - | |
| 11106 | + | |
11103 | 11107 | | |
11104 | | - | |
11105 | | - | |
11106 | | - | |
11107 | | - | |
11108 | | - | |
| 11108 | + | |
| 11109 | + | |
| 11110 | + | |
| 11111 | + | |
| 11112 | + | |
| 11113 | + | |
| 11114 | + | |
| 11115 | + | |
| 11116 | + | |
| 11117 | + | |
| 11118 | + | |
| 11119 | + | |
| 11120 | + | |
11109 | 11121 | | |
11110 | 11122 | | |
11111 | 11123 | | |
| |||
11127 | 11139 | | |
11128 | 11140 | | |
11129 | 11141 | | |
11130 | | - | |
| 11142 | + | |
11131 | 11143 | | |
11132 | 11144 | | |
11133 | 11145 | | |
| |||
0 commit comments