Re: How to know if a table exist in a Stored Procedure?
- From: "Grupo ESI" <Pedir@xxxxxxxxxxxxxxx>
- Date: Wed, 13 Sep 2006 10:49:03 -0300
Thanks Arnie!
--
Jorge L. Cotarelo
"Arnie Rowland" <arnie@xxxxxxxx> escribió en el mensaje news:OuvRvu10GHA.4448@xxxxxxxxxxxxxxxxxxxxxxx
Of course, if you wanted to avoid accessing the system tables, and create code that will still work in future versions (when syscomments is no longer available), try something like this:
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'MyTable'
(But then again, contrary to Microsoft's assertions, the INFORMATION_SCHEMA views may not be around in the future. But we have been warned about using the system tables.)
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Hari Prasad" <hari_prasad_k@xxxxxxxxxxx> wrote in message news:uhJ87V00GHA.4972@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> use dbname
> go
> Select object_name(id) from syscomments where text like '%table_name%'
>
> Replace table_name with actual table name.
>
> Thanks
> Hari
> SQL Server MVP
>
>
> "Grupo ESI" <Pedir@xxxxxxxxxxxxxxx> wrote in message
> news:eRsvJT00GHA.720@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> Can anybody please tell me How to know if a table exist in a Stored
>> Procedure?
>>
>> Thanks in advance,
>>
>> --
>> Jorge L. Cotarelo
- References:
- How to know if a table exist in a Stored Procedure?
- From: Grupo ESI
- Re: How to know if a table exist in a Stored Procedure?
- From: Hari Prasad
- How to know if a table exist in a Stored Procedure?
- Prev by Date: dump msde database
- Next by Date: Re: Jobs in SQLExpress 2005
- Previous by thread: Re: How to know if a table exist in a Stored Procedure?
- Next by thread: Idenifying MSDE and MSDE Version via Registry
- Index(es):
Relevant Pages
|
Loading