Skip to content

Instantly share code, notes, and snippets.

@Alcar32
Created May 15, 2013 23:11
Show Gist options
  • Save Alcar32/5588153 to your computer and use it in GitHub Desktop.
Save Alcar32/5588153 to your computer and use it in GitHub Desktop.
/* This sql script checks if table with name TEST_TBL exists.
* The resultset of this query is column name '1' with one row,
* if the row contains a greate than '1' then the table exists.
* If it '0' the table doesn't exist.
*
*/
select count(*) from SYS.SYSTABLES, SYS.SYSCOLUMNS
where SYS.SYSTABLES.TABLEID=SYS.SYSCOLUMNS.REFERENCEID
and SYS.SYSTABLES.TABLENAME = 'TEST_TBL';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment