Top "Table-variable" questions

A SQL Server local variable that can store rows.

Dynamic query results into a temp table or table variable

I have a stored procedure that uses sp_executesql to generate a result set, the number of columns in the …

sql-server dynamic-sql temp-tables table-variable sp-executesql
How to use a table variable in an "update from select" query?

I have this table variable declaration followed by a query: DECLARE @CurrentItems TABLE ( ItemId uniqueidentifier, ItemUnits int ) UPDATE U SET …

sql sql-server sql-server-2005 tsql table-variable
Very slow DELETE query

I have problems with SQL performance. For sudden reason the following queries are very slow: I have two lists which …

sql sql-server performance sql-execution-plan table-variable
Structured types must have at least one field c#

What I actually want to do is I want to send a string array to SQL Server. I am using …

c# sql-server stored-procedures table-variable
Why are temporary tables faster than table variables for joins?

Why are temporary tables faster than table variables for joins in SQL Server? NOTE: In both scenarios the tables have …

sql-server join table-variable temp-tables
Table variable poor performance on insert in SQL Server Stored Procedure

We are experiencing performance problems using a table variable in a Stored Procedure. Here is what actually happens : DECLARE @tblTemp …

sql-server stored-procedures temp-tables table-variable
T-SQL Table variable with case sensitive columns - collate SQL_Latin1_General_CP1_CS_AS

Is it possible to have collate SQL_Latin1_General_CP1_CS_AS in table variable columns' definitions? The reason I …

sql-server tsql table-variable collate
Get definitive names for columns from table variable

I can declare a table variable as such: DECLARE @tv_source TABLE(c1 int, providerName varchar(50), providerSMS varchar(50)) If I …

sql sql-server sql-server-2008 table-variable
How to save a queried CTE output into a temporary table or table variable

I have a CTE and query this one ;With CTE_Table as (SELECT ...) Select * from CTE_Table Now I try …

sql tsql common-table-expression sql-server-2014 table-variable
How call Table Values function from stored procedure

How to call function which returns table in stored procedure. I want to do use that returned table from function …

sql-server-2008 stored-procedures table-valued-parameters table-variable