Top "Table-variable" questions

A SQL Server local variable that can store rows.

TSQL Define Temp Table (or table variable) Without Defining Schema?

Is there a way to define a temp table without defining it's schema up front?

sql-server tsql schema temp-tables table-variable
How to take table name as an input parameter to the stored procedure?

I have a small stored procedure below. I am taking the table name as an input parameter to the stored …

sql-server stored-procedures table-variable
PostgreSQL table variable

Is there anything like table variables in T-SQL? In Sql Server it looks like this: DECLARE @ProductTotals TABLE ( ProductID int, …

sql postgresql plpgsql table-variable
How to use a record type variable in plpgsql?

How can I use query result stored into a record type variable for another query within the same stored function? …

postgresql function variables plpgsql table-variable
How to fix "Must declare the scalar variable" error when referencing table variable?

I can't figure out why (or maybe you just can't do this) I get the out of scope error Must …

sql-server tsql table-variable
How to check if a table variable is empty in SQL Server?

This is a section of one of my stored procedure: @dataInTable dbo.Table_Variable readonly, .... AND ( ( @dataInTable IS NULL ) OR ( …

sql-server tsql null table-variable
Inserting multiple rows into a SQL Server table using a table variable

I am currently using SQL Server 2008, and I am trying to create a statement using a table variable to insert …

sql sql-server-2008 insert table-variable
TSQL table variable initialization

I have the following TSQL table variable: declare @NumDaysMonth table ( month_id smallint, num_days smallint ) I just want a …

sql tsql lookup-tables table-variable
How to view data in table variables during debugging session in MS SQL Management Studio 2012?

I would like to debug a complex T-SQL script using SSMS 2012. I can run the script in debug mode and …

debugging sql-server-2012 ssms table-variable