SQL Server Performance

How to call procedure/function without schema name

Discussion in 'General DBA Questions' started by sanjay_erp, Dec 11, 2002.

  1. sanjay_erp New Member

    Hi All,
    I have created a function in sqlserver,but while calling i have give like schema.function name.
    User Name - sanjay
    procedure Name - Last_Date
    Then I have to call like sanjay.Last_date but I want to call my procedure or function without giving my schema name like Last_date.So, please advice me how to call as I am calling this in my SELECT QUERY.
    Thanks for your help in advance

    Sanjay Kumar
  2. HarryArchibald New Member

    FYI, MS recommend that a stored procedure is called using the schema name. Thus a stored procedure called StoredProcedure should be called by dbo.StoredProcedure. This avoids a compile lock being acquired on the stored procedure.

    In addition, it is good practice not to use a schema name other than dbo.


  3. sanjay_erp New Member

    Thanks Harry,that means there is no way to call procedure/function without giving schema name before procedure/function. Harry,sorry but actually I m oracle guy just came into sqlserver so it is new for me so may be this is very basic doubts,but appericiate ur help on the same.

    Sanjay Kumar
  4. satya Moderator

    Books online for SQL server has got valuable tips and information for newbie's, worth referring to it.

    Satya SKJ
  5. bradmcgehee New Member

    For best performance, it is always a good idea to use the owner_name.object_name format. If you do this, SQL Server won't have to manually resolve the object owner's name, which saves a little bit of overhead.

    Brad M. McGehee

Share This Page