Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking if table exists or not in SQL Azure

Could anyone help me in checking whether table exists or not in sql azure?

like image 514
DSKVP Avatar asked Feb 21 '23 17:02

DSKVP


1 Answers

Use this query -

SELECT
  *
FROM
  sys.tables t
JOIN
  sys.schemas s
    ON t.schema_id = s.schema_id
WHERE
  s.name = 'dbo' AND t.name = 'table1'

...specify your schema and table name.

like image 69
Devart Avatar answered Feb 24 '23 16:02

Devart