> >Hi,
> > Is there a way to avoid explicitly specify a table on another database
in
> >store procedures? My thinking was to use alias or synonym for that
> >particular table. I looked it up in Sybase manuals and I didn't find
any
> >info. on it. I want to use alias just in case the table is moved to
> >another database or to the same database, therefore, only the change
alias
> >or synonym not the store procedures. Please reply via e-mail or
re-post.
> >Thanks in advance,
> >Minh Giang
> Sure, Use a sybase view. Say you have database DB1 and database DB2.
> If you've got table tbl1 in DB1 and you want to reference it in DB2
> you can create a view like:
> use DB2
> go
> create view tbl1 as select * from DB1..tbl1
> go
> And the stored procedures can reference the view same way as a table.
> Look up "View" in Sybase manuals.
> Mike
Ok, I'll give it a shot, but there's a concern with view. Does Sybase10
view uses index? This is a very large table I'm referring to (100+ million
rows). BTW, because of the size of this table, update statistic was never
done on this huge table. Most of my querries are simple query that use
forced index to get Sybase to use the correct index.
Regards,
Minh Giang