I need to get information about amount of columns and types of these columns in certain table. I hear something about INFORMATION_SCHEMA.COLUMNS. But there are no my tables in it! What is wrong?
Asked
Active
Viewed 125 times
0
-
1You are querying the `master` database. You need to switch context to your own database – HoneyBadger May 17 '17 at 08:39
-
As an aside, [INFORMATION_SCHEMA isn't all it's cracked up to be](http://stackoverflow.com/a/3654313/4137916). – Jeroen Mostert May 17 '17 at 08:43
1 Answers
1
You are using master
database.
Choose your database by USE
USE [YourDAtaBaseName]
SELECT * FROM INFORMATION_SCHEMA.Tables

TriV
- 5,118
- 2
- 10
- 18