1. By using the OBJECT_ID() function
If OBJECT_ID('my_table', 'U') is not null
BEGIN
print 'my_table Table exists'
END
2. By using the INFORMATION_SCHEMA.TABLES
If exists (SELECT * FROM INFORMATION_SCHEMA.TABLES Where table_name = 'my_table')
BEGIN
print 'my_table Table exists!'
END
3. By using sys.Objects Catalog view
If exists(Select * from sys.objects where object_id = OBJECT_ID('my_table') and type = 'U')
BEGIN
print 'my_table Table exists!'
END
Read: https://docs.microsoft.com/en-us/sql/relational-databases/system-information-schema-views/system-information-schema-views-transact-sql?redirectedfrom=MSDN&view=sql-server-ver15
More Posts related to HowTos,
- Brew Error - This command updates brew itself and does not take formula names
- How to get more information about npm using brew command
- How to find the path of formula Installation by Brew
- MongoDB: Failed to connect to 127.0.0.1:27017 reason: Connection refused
- Clearing the Cache in Firefox Web Browser
- How to enter Rockstar Activation Code?
- How to display line numbers in Terminal while displaying content of a file
- How to install Postman natively on a Mac
- ChatGPT Outage: Hmm...something seems to have gone wrong. Maybe try me again in a little bit.
- Copy all .vcf Mobile Contacts files into one .vcf
- How to Whitelist IP Address on GoDaddy Hosting?
- How to check the version of NodeJS installed
- How to remove password from pdf file
- Top 10 emerging breakthrough trending technologies
- How to press shortcut CTRL + ALT + DEL on Windows Remote Desktop
- Gmail Unable to upload because it is a folder or a package (like an application bundle or RTFD document)
- How to write hello world different languages syntax
- [fix] Editor could not be opened unexpected error: File is a directory (VS Code)
- How to generate ssh key?
- How to Change or Set a new Password for your Wi-Fi Router
- [Error] zsh: command not found: mvn
- What is an Authorization Code Grant? OAuth 2.0
- Install SonarLint on Visual Studio Code
- Unzip a Zip file from Terminal Command
- Format Code in Visual Studio - VS Code [Mac/Windows/Linux]
More Posts:
- Informal written computer correspondence acronyms list and meanings - 2022
- How to remove blank lines from a file using Notepad++ - NotepadPlusPlus
- How to Uninstall Android Studio on Mac - Android-Studio
- Get Current Local Date and Time using Java 8 DateTime API - Java
- How to know my IP on Mac Ventura 13.0 - MacOS
- macOS Ventura XCode Command Line Tools Installation - MacOS
- How to kill tomcat server process using Mac Terminal Command - Tomcat
- Android Studio : Connection Error : Failed to download patch file - Android-Studio