那要看是什么数据库了,如果是oracle的话可以用 select * from tabs where TABLE_NAME = ... 进行查询,其他的库,提供的数据字典的view是不同的 你要参考相关文档了
if fielexists('c:\zz.dbf') then showmessage('ok');
以下是 sqlserver中的判断,可以使用ADOQUERY来返回结果。 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[u_book_binding]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[u_book_binding]
select * from sysobjects where name='TableName'
use DataBaseName select Count(*) from SysObjects where Name = 'TableName'
select * from tabs where TABLE_NAME = ...
进行查询,其他的库,提供的数据字典的view是不同的
你要参考相关文档了
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[u_book_binding]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[u_book_binding]
select Count(*) from SysObjects where Name = 'TableName'