Search code examples
sql-serverstored-proceduresssmsadventureworks

sp_column not considering @Column_name


I'm reading the official Microsoft guide about sp_columns and I'm trying to retrieve only one specific column from AdventureWorks2016.dbo.Person.Address:

exec sp_columns @table_name = 'Person.Address', @Column_name = 'NULLABLE'

SSMS is retrieving all all columns as empty

enter image description here

The Microsoft documentation says I can use @Column_name


Solution

  • If you execute this:

    exec sp_columns @table_name = 'Address'
    

    You should get the following:

    enter image description here

    How ever the @Column_name = 'NULLABLE' does not exist in the table

    enter image description here

    And if you run the query with the correct name of the column you will get it working.

    For example this:

    exec sp_columns @table_name = 'Address', @Column_name = 'AddressID'
    

    enter image description here