output-clause Questions
1
Solved
Microsoft's OUTPUT Clause documentation says that you are allowed to use from_table_name in the OUTPUT clause's column name.
There are two examples of this:
Using OUTPUT INTO with from_tab...
Jimmie asked 25/3, 2020 at 12:26
3
Solved
I want to know how many rows were removed in a certain DELETE operation.
I took the Microsoft example B which is
DELETE Sales.ShoppingCartItem
OUTPUT DELETED.*
WHERE ShoppingCartID = 20621;
an...
Veneration asked 15/6, 2015 at 11:37
8
I have seen various methods used when retrieving the value of a primary key identity field after insert.
declare @t table (
id int identity primary key,
somecol datetime default getdate()
)
inse...
Build asked 26/1, 2009 at 21:19
2
Solved
I have a table with two columns:
CREATE TABLE MyTable(
Id int IDENTITY(1,1) NOT NULL,
Name nvarchar(100) NOT NULL);
I want to duplicate the data using SELECT INSERT statement:
INSERT INTO MyT...
Courson asked 10/7, 2014 at 14:32
2
Solved
I have two tables, Table_1 and Table_2.
Table_1 has columns PK (autoincrementing int) and Value (nchar(10)).
Table_2 has FK (int), Key (nchar(10)) and Value (nchar(10)).
That is to say, Table...
Hightail asked 26/10, 2012 at 20:38
2
Solved
I am a little stuck with why I can not seem to get the 'new identity' of the inserted row with the statement below. SCOPE_IDENTITY() just returns null.
declare @WorkRequestQueueID int
declare @Las...
Bergamo asked 2/10, 2012 at 21:11
1
Solved
Currently, I'm trying to perform an update in SQL Server (but it could be any DML statement that supports the output clause), and I'd like to put the output into a local temp table, like so:
updat...
Aristophanes asked 31/5, 2012 at 18:18
1
I am trying to use the OUTPUT clause inside a stored procedure to output to a temporary table the values of an indentity column after an INSERT.
CREATE TABLE #Test
(
ID INT
)
INSERT INTO [TableB...
Granvillegranvillebarker asked 9/6, 2011 at 11:35
1
Solved
I am running in to the dreaded "The multi-part identifier could not be bound" error on a stored procedure I am currently working on. I have a few questions in regards to the query below.
Why am I...
Tie asked 31/1, 2011 at 20:13
1
© 2022 - 2024 — McMap. All rights reserved.