C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

please correct this procedure


Posted Date: 11 Jan 2009      Posted By: Christopher      Member Level: Gold     Points: 1   Responses: 2



alter proc dd
@a int,
@b int,
@c int out
as
set @a= (select count(*) from holiday where a_year='2009-2010')
set @b= (SELECT DATEDIFF(day,Begin_date,Getdate())Totaldays from school_registration)
set @c=@b-@c





Responses

Author: Babu Akkandi    11 Jan 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 3

Hi,

use this procedure,



alter procedure dd
(
@c int output
)
As
Begin

Declare @a int
Declare @b int
set @a= (select count(*) from holiday where a_year='2009-2010')
set @b= (SELECT DATEDIFF(day,Begin_date,Getdate())Totaldays from school_registration)
set @c=@b-@a
End



To test this procedure thru query analyser, use the following query



Declare @d int
set @d = 0
exec dd @d output
select @d



Hope It Helps!

Thanks and Regards,
Babu Akkandi
Microsoft Technology



Author: Dhaval Shah    12 Jan 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

alter procedure dd
(
@c int output
)
As
Begin

Declare @a int
Declare @b int
set @a= (select count(*) from holiday where a_year='2009-2010')
set @b= (SELECT DATEDIFF(day,Begin_date,Getdate())Totaldays from school_registration)
set @c=@b-@a
End



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : manipulate data please help me helpme
Previous : SQLEXPRESS
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use