List Info

Thread: Re: Capture output of T-SQL PRINT 'text' Statement using ADO.NET




Re: Capture output of T-SQL PRINT 'text' Statement using ADO.NET
country flaguser name
United States
2007-06-22 07:46:08
use Success as an output parameter and in calling code
look at it's value
to work out what to show to the user.


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:ADVANCED-DOTNETDISCUSS.DEVELOP.COM]On Behalf Of Doug
Wilson
Sent: Thursday, June 21, 2007 7:03 PM
To: ADVANCED-DOTNETDISCUSS.DEVELOP.COM
Subject: [ADVANCED-DOTNET] Capture output of T-SQL PRINT
'text'
Statement using ADO.NET


I've spent quite a bit of time trying to figure this out but
so far I've got
nothing.  I figure this is a long shot, but hopefully
someone here can help
me out.

Say I've got a Stored Procedure in SQL Server 2000 (or 2005)
that's similar
to the following:

CREATE PROCEDURE [dbo].[Upgrade_Member]
(
  MemberUID UNIQUEIDENTIFIER,
  PackageUID UNIQUEIDENTIFIER
)
AS

/* Do the upgrade */

IF Success = 1
BEGIN
   PRINT 'Upgrade Successfull'
   COMMIT TRANSACTION
END ELSE
BEGIN
   PRINT 'Upgrade Failed'
END


Is there any way in ADO.NET to capture the ouput of the
PRINT statements?  I
know I could use Output Parameters or even a SELECT 'Upgrade
Successful' but
there are 100s of procedures in this system already that I
really cannot
afford to re-write.

Thanks in advance.

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com


===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )