2418524 - Table scan may be chosen if a local variable is used as a search argument in a select into statement in a stored procedure - SAP ASE | SAP Knowledge Base Article

SAP Knowledge Base Article - Preview

2418524 - Table scan may be chosen if a local variable is used as a search argument in a select into statement in a stored procedure - SAP ASE

Symptom

  • Table scan may be chosen if a local variable is used as a search argument in a select into statement in a stored procedure like below.

create procedure test1_proc2
as
declare @col1 int
select @col1 = 10
select * into #temp from test1 where col1 = @col1

  • As a result, the query performance can slow down.

Read more...

Environment

  • SAP Adaptive Server Enterprise (ASE) 15.x
  • SAP Adaptive Server Enterprise (ASE) 16.0

Product

SAP Adaptive Server Enterprise 15.7 ; SAP Adaptive Server Enterprise 16.0

Keywords

procedure deferred compilation, slow, drop, performance, local variable, tablescan, indexscan, select-into , KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.