----- Original Message -----
From: Seong Y. Kim <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 11, 1999 2:48 AM
Subject: how do you know if a data table exists?


> Hi, all
>
> Does anyone of you know how to check if a certain data table exists?
> I need to know if the data table that I want to create exists.  If not, I
need
> to create one.
>
> Any of information will be appreciated.
>
>
> ***   Seong Y. Kim (Software Engineer)
> ***   Convergent Network Technologies, Inc.
> ***   1420 Harbor Bay Parkway suite 281, Alameda, CA 94502
> ***   Tel: (510) 522-5077 x214, Fax: (510) 522-1228
>
Hi Seong,

depending on your server and JDBC bridge you can either grab the metadata
for that database
and check for the presence of that table or write a stored procedure that
does something like this

if not exists (select 1
            from  sysobjects
            where  id = object_id('your_table')
            and    type = 'U')
begin
  create table your_table
  (
      field1              field_type               null|not null|identity,
      field2              field_type               null|not null
  )
end /* IF */

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to