Nwosu Vincent
Newbie
Points: 2
More actions
June 16, 2006 at 9:55 am
#366474
i am working on an application that requires me to know whether a particular table in a database has been already created. if it has not, it will create the table, but if the table has been created, the creation process should be bypassed.
paul_richardson
SSCarpal Tunnel
Points: 4594
June 16, 2006 at 9:58 am
#644338
hi, try something like :-
if not exists (select 1 from INFORMATION_SCHEMA.TABLES
where TABLE_NAME = '{table_name})
begin
create table {table_name} (columns ...)
end
Paul
June 17, 2006 at 5:04 am
#644452
Thanks Paul. I will try that out.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply