Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in SQL by (55.5k points)

Can anyone tell me how to check if the table exists in SQL?

1 Answer

0 votes
by (119k points)

Here is the SQL query to check if the Employee table exists in SQL server:

IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = N'Employee')

BEGIN

    PRINT 'Table Exists'

END

In MySQL, there is a simple query to check if the Employee table exists:

SHOW TABLES LIKE '%Employee%';

If you want to learn SQL from Industry experts then check out this SQL course by Intellipaat that provides Instructor-led training, hands-on experience, and certification.

Related questions

0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 18, 2019 in SQL by Tech4ever (20.3k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.6k users

Browse Categories

...