How to Quickly List Table Column Names in Any SQL Server Database

preview_player
Показать описание
If you find this SQL tutorial useful please LIKE and SUBSCRIBE!

In this video I show three techniques of querying a SQL Server database and returning a list of column names from any database table.

00:00 - Introduction
00:14 - Querying sp_columns
03:27 - Querying INFORMATION_SCHEMA

If you get any errors while using these techniques, or they don't return the data you're expecting then check your SQL user privileges.

Just bear in mind that these techniques may return slightly different results sets depending on what database version you're using. The full documentation for the methods used in this tutorial are available here:

Рекомендации по теме
Комментарии
Автор

after 5 videos, this one was the best I could get. Thanks!

projects
Автор

Greetings! This was helpful. Thanks for sharing.

terngun
Автор

Hello Thank you for the video.

So if I have a database called Pets, with a table in it called MediumPets and I want to return the column names in that table that contain the word Poodle.

I can write;
1. sp_column 'MediumPets'
2. Select * from MediumPets.columns where Name Like '%Poodle%'
3. Select * from Pets where MediumPets Like '%Poodle%'

I tried all 3 of these in teradata sql and got errors for all.

abbykimz
Автор

Hi sir, can we use minus symbol(-) in the database as columns names

madhavarapurajendra