# Database Discussions > Sybase >  Some Questions

## shubhada99

Hi,
Plz give me answer for following questiions

1. Which step we will follow to imporve the performance of any stored procedure?
(which component should we check?)

2. Which step we will follow to imporve the performance of any query?

3. Difference between sp_recomplie and update_statics

4. have one table with A1 B1 C1 column and i want to do bcp in from a excel 
file. but excel ile the column sequence as C1 B1 A1 .
how i can bcp in? (BCP command)

5. How error handling is done in stored procedure?

6. why we use temporary table and drawbacks of tepoparary table?

7. What is Index covering?

----------


## Suda Rao

1. for the queries you have inside a stored proc, check to see if they use indexes, wat are the query plans etc, set showplan on. set noexec on etc will tell u wat are the steps the optimizer is taking before it runs the query. 

2. same as above

3. sp_recompile <table name> is specified after ui run update stats so that pre-compiled queries (views/procs) can make use of the new stats. while update stats actaully updates the stats of table/index etc. 

4. create a view with the columns order as needed and then use the view in the bcp out. 

5. read documentation. 

6. temporary tables (# tables) are used to store temporary data, like work tables which are needed sometimes to do some data manipulation and they may be dropped once the task is done. this is created in the tempdb which is the scratch pad database that can be used by all, and is usually faster than creating a table in the user database. The drawback is taht the tempdb is cleared everytime a server (ASE) is shutdown, so DO NOT keep permanent tables in the tempdb.

----------

