Debug a stored procedure using temporary tables and breakpoints
You must be connected to the database that contains the stored procedure you want to debug.
In this example, you create two stored procedures (Bproc and Aproc) that references a temporary table. Once created, you could set breakpoints to debug the stored procedures.
CREATE PROCEDURE dbo.Bproc AS BEGIN Print 'This is Bproc' END
Select * from #qty_table
Enter the correct column names, column types, and optionally add the 'create index' and 'insert' statements.
The annotations are generated when successfully saved :
/** Warning: This annotation was generated by temporary table wizard. Do not edit it. @TemporaryTableName #qty_table create table #qty_table ( lowqty int, highqty int ) --The following statement(s) will be executed automatically after creation of this temp table. --User is responsible for the statement(s)'s content and validation. --Add index creation statement below CREATE NONCLUSTERED INDEX idx_dbidname ON #qty_table (lowqty, highqty) --Add insert statement below insert #qty_table values (9, 999) insert #qty_table values (8, 899) insert #qty_table values (7, 799) insert #qty_table values (6, 699) */ CREATE PROCEDURE dbo.Bproc AS BEGIN Print 'This is Bproc' select #qty_table.lowqty, #qty_table.highqty from #qty_table END
CREATE PROCEDURE dbo.Aproc AS BEGIN Print 'This is Aproc' END
CREATE PROCEDURE dbo.Aproc AS BEGIN Print 'This is Aproc' create table #qty_table ( lowqty int, highqty int ) ALTER TABLE #qty_table ADD PRIMARY KEY CLUSTERED (lowqty ASC ) CREATE NONCLUSTERED INDEX idx_dbidname ON #qty_table (lowqty, highqty) select #qty_table.lowqty, #qty_table.highqty from #qty_table insert #qty_table values (9, 999) insert #qty_table values (8, 899) insert #qty_table values (7, 799) insert #qty_table values (6, 699) exec Bproc END
For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com