hello,
i would like to write a batch file with all sql commands necessary to create
a database, its tables, and populate them with initial data.
would the experts please help me with these problems:
1. how to programmaticall y, in sql script, check if a known database already
exists on the server, and drop it if it does?
2. similarly, how to check if a table exists and drop it?
something similar to MSSQL's:
if exists(select * from sysobjects where id = object_id('tabl ename') and
objectproperty( id, 'isusertable') = 1)
drop table tablename
thanks for any help
konstantin
i would like to write a batch file with all sql commands necessary to create
a database, its tables, and populate them with initial data.
would the experts please help me with these problems:
1. how to programmaticall y, in sql script, check if a known database already
exists on the server, and drop it if it does?
2. similarly, how to check if a table exists and drop it?
something similar to MSSQL's:
if exists(select * from sysobjects where id = object_id('tabl ename') and
objectproperty( id, 'isusertable') = 1)
drop table tablename
thanks for any help
konstantin
Comment