Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Delete Query..

Author  Topic 

harshilshah
Starting Member

8 Posts

Posted - 2012-12-30 : 23:47:34
How do i get the no of rows effected from a delete query

something like:

row_affected= delete from weight where name="xyz";

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2012-12-30 : 23:55:49
Do you need this?

Declare @row_affected int
Delete from table_name where 1=2
Set @row_affected=@@ROWCOUNT

Select @row_affected

Senthil Kumar C
------------------------------------------------------
MCITP - Database Administration SQL SERVER 2008
MCTS - Database Development SQL SERVER 2008
Go to Top of Page

harshilshah
Starting Member

8 Posts

Posted - 2012-12-31 : 00:05:03
@senthil:

How do i get this working in C++ ??
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-01 : 23:49:34
quote:
Originally posted by harshilshah

@senthil:

How do i get this working in C++ ??


put logic as procedure and call it from C++

http://www.codeproject.com/Articles/15403/Calling-Stored-procedures-in-ADO-NET

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -