273
Views
4
Comments
Solved
Affected rows of a delete query
Question

How to get affected rows in a SQL delete. Like we do @@ROWCOUNT in SQL server.

I can do a count(*) before and after SQL delete  but is there any other efficient way?


Thanks in advance.

2019-06-15 21-39-22
Afonso Carvalho
 
MVP
Solution

Hi Iakshmi,

Try injecting the @@ROWCOUNT parameter like this:

And make sure Expand Inline is set to Yes.

UserImage.jpg
lakshmi Dupati

Afonso Carvalho wrote:

Hi Iakshmi,

Try injecting the @@ROWCOUNT parameter like this:

And make sure Expand Inline is set to Yes.


Thank you very much Afonso. Its working. 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Lakshmi,

Iirc, you need an Output Structure with a single Integer Attribute, and add

; SELECT @@ROWCOUNT

after the DELETE statement.

UserImage.jpg
lakshmi Dupati

Kilian Hekhuis wrote:

Hi Lakshmi,

Iirc, you need an Output Structure with a single Integer Attribute, and add

; SELECT @@ROWCOUNT

after the DELETE statement.

Thanks for the response Kilian .

I am getting the unknown ROWCOUNT error now.


2019-06-15 21-39-22
Afonso Carvalho
 
MVP
Solution

Hi Iakshmi,

Try injecting the @@ROWCOUNT parameter like this:

And make sure Expand Inline is set to Yes.

UserImage.jpg
lakshmi Dupati

Afonso Carvalho wrote:

Hi Iakshmi,

Try injecting the @@ROWCOUNT parameter like this:

And make sure Expand Inline is set to Yes.


Thank you very much Afonso. Its working. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.