How do I get a list of fields in a table in SQL?

Getting The List Of Column Names Of A Table In SQL Server

  1. Information Schema View Method. You can use the information schema view INFORMATION_SCHEMA.
  2. System Stored Procedure SP_COLUMNS Method. Another method is to use the system stored procedure SP_COLUMNS.
  3. SYS.COLUMNS Method.
  4. SP_HELP Method.

How do I find column details in SQL Server?

Using the Information Schema

  1. SELECT TABLE_NAME FROM INFORMATION_SCHEMA. TABLES.
  2. SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA. COLUMNS.
  3. SELECT COLUMN_NAME FROM INFORMATION_SCHEMA. COLUMNS WHERE TABLE_NAME = ‘Album’
  4. IF EXISTS( SELECT * FROM INFORMATION_SCHEMA.
  5. IF EXISTS( SELECT * FROM INFORMATION_SCHEMA.

How do I get a list of modified stored procedures in SQL Server?

You can use sys.proceedures to find the date of the most recent modification for stored procedures;

  1. SELECT [name], create_date, modify_date.
  2. FROM sys.procedures.
  3. ORDER BY 3 DESC;

How can I tell when a SQL Server table was modified?

The query: SELECT name AS TableName, create_date AS CreatedDate, modify_date as ModifyDate FROM sys. tables order by ModifyDate; …will tell me the last time a table was created and modified (from a DDL perspective).

How can I see who modified a stored procedure in SQL?

Accessing the log file in SQL Server Profiler

  1. Open the desired log file with SQL Server Profiler.
  2. You can see the stored procedure name in the ObjectName column and the name of the user who modified the stored procedure name in the LoginName column.

How do you identify all Stored Procedures referring a particular table?

How to identify all stored procedures referring a particular…

  1. SELECT Name.
  2. FROM sys.procedures.
  3. WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE ‘%TableNameOrWhatever%’