Last active
April 5, 2020 07:54
-
-
Save HammadMaqbool/88d630c40a1e85d84d2b1f9d40bcb603 to your computer and use it in GitHub Desktop.
Attribute name availablity checking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Check Attribute name availablity*/ | |
SELECT TABLE_NAME FROM DataBaseName_Here.INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = ‘Name' | |
--To check all the tables available in the Database | |
SELECT TABLE_NAME, TABLE_TYPE FROM DataBaseName_Here.INFORMATION_SCHEMA.TABLES ORDER BY TABLE_NAME | |
--To Get the list of columns | |
SELECT COLUMN_NAME FROM DataBaseName_Here.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Table Name here' | |
/*Queries to get all the data*/ | |
SELECT * FROM INFORMATION_SCHEMA.TABLES | |
SELECT * FROM INFORMATION_SCHEMA.COLUMNS | |
SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE | |
/*You need to follow this tutorial to learn the usage of these | |
queries | |
link of the tutorial: https://youtu.be/4uvZtmRWS44*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment