SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Delete Query..
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

harshilshah
Starting Member

India
8 Posts

Posted - 12/30/2012 :  23:47:34  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
1007 Posts

Posted - 12/30/2012 :  23:55:49  Show Profile  Visit senthil_nagore's Homepage  Send senthil_nagore a Yahoo! Message  Reply with Quote
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

India
8 Posts

Posted - 12/31/2012 :  00:05:03  Show Profile  Reply with Quote
@senthil:

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

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 01/01/2013 :  23:49:34  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000