Qualifying names inside procedures

Inside a stored procedure, object names used with create table and dbcc must be qualified with the object owner’s name, if other users are to use the stored procedure. Object names used with other statements, like select and insert, inside a stored procedure need not be qualified because the names are resolved when the procedure is compiled.

For example, user “mary”, who owns table marytab, should qualify the name of her table when it is used with select or insert if she wants other users to execute the procedure in which the table is used. The reason for this rule is that object names are resolved when the procedure is run. If marytab is not qualified, and user “john” tries to execute the procedure, Adaptive Server looks for a table called marytab owned by the owner of the procedure (“john” in this case) or by the Database Owner if the user table (“marytab” in this case) does not exist.