Byte My Data

A personal collection of advice and solutions I've used.

About the author

Something about the author

How to find all tables with a specific column name in MS SQL

Simple and effective:

SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE COLUMN_NAME LIKE 'INVOICE%'

Permalink | Comments (2) | Post RSSRSS comment feed

Insert into table using a stored procedure.

This examble is using a table variable.

DECLARE  @People TABLE (
    ContactID INT,
    FirstName NVARCHAR(50),
    LastName NVARCHAR(50)
)

INSERT @People (ContactID, FirstName, LastName)
EXEC dbo.GetPeopleByLastName @LastName = 'Alexander'

Permalink | Comments (2) | Post RSSRSS comment feed