Re: how to know the table is exist in the database



Hi Mark,

Actually, executing sp_tables stored procedure is better since sysobjects
structure or accesibility might change at some point.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Mark Rae" <mark@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uWemvlT2FHA.3420@xxxxxxxxxxxxxxxxxxxxxxx
> "joy.net" <luxingyu1@xxxxxxxxxxx> wrote in message
> news:%23DX0hgT2FHA.3912@xxxxxxxxxxxxxxxxxxxxxxx
>
> Depends on the database and/or on the database access method...
>
> E.g. if you want to know if the Orders table exists in SQL Server, send it
> the following scalar query:
>
> SELECT COUNT(*) FROM sysobjects WHERE name = 'Orders'
>
> If the result is 1, the table exists - if the result is 0, the table
> doesn't exist.
>


.



Relevant Pages

  • Re: how to know the table is exist in the database
    ... > Depends on the database and/or on the database access method... ... > the following scalar query: ... > SELECT COUNTFROM sysobjects WHERE name = 'Orders' ... Prev by Date: ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: how to know the table is exist in the database
    ... Depends on the database and/or on the database access method... ... E.g. if you want to know if the Orders table exists in SQL Server, ... SELECT COUNTFROM sysobjects WHERE name = 'Orders' ... Prev by Date: ...
    (microsoft.public.dotnet.framework.adonet)

Loading