Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2007, 10:33 PM
Registered User
 
Join Date: Jul 2007
Location: hyderabad, andhra pradesh, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default topic

give me a example which uses both input and out parameter in stored procedure......with code and explanation.....asap......

paramesh

aparam
Reply With Quote
  #2 (permalink)  
Old July 9th, 2007, 10:42 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Not even a "please"?

Look in BOL under CREATE PROCEDURE.

CREATE PROCEDURE Production.uspGetList @Product varchar(40)
    , @MaxPrice money
    , @ComparePrice money OUTPUT
    , @ListPrice money OUT
AS
    SELECT p.[Name] AS Product, p.ListPrice AS 'List Price'
    FROM Production.Product AS p
    JOIN Production.ProductSubcategory AS s
      ON p.ProductSubcategoryID = s.ProductSubcategoryID
    WHERE s.[Name] LIKE @Product AND p.ListPrice < @MaxPrice;
-- Populate the output variable @ListPprice.
SET @ListPrice = (SELECT MAX(p.ListPrice)
        FROM Production.Product AS p
        JOIN Production.ProductSubcategory AS s
          ON p.ProductSubcategoryID = s.ProductSubcategoryID
        WHERE s.[Name] LIKE @Product AND p.ListPrice < @MaxPrice);
-- Populate the output variable @compareprice.
SET @ComparePrice = @MaxPrice;
GO



Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html
Reply With Quote
  #3 (permalink)  
Old July 10th, 2007, 01:56 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

This forum is going to hell. What kind of topic is "topic"? Is there any way we can filter "help", "emergency", "please" out of the topic field. Everyone that posts here is asking for help or they wouldn't be posting a question. And I don't think anyone is going to answer any faster if you put "emergency" or "urgent" in the topic. In fact, the way things are going here you might even get less response. So topics like, "Please help me", "urgent", and "emergency" should get canned.

Good manners goes a long way, like saying, "Please" or "Any ideas would be very much appreciated."

All of this rude language is fairly new to this newsgroup within the last year or so.

Reply With Quote
  #4 (permalink)  
Old July 10th, 2007, 02:36 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I agree. I also think we could "help" out the forum is by ignoring those posts who don't who good manners (this from the who answered one with poor manners...slap on the wrist). Hopefully, they'll figure out why they aren't getting a response.

Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html
Reply With Quote
  #5 (permalink)  
Old July 10th, 2007, 02:45 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Sounds like a plan. Or just post a link to this or a similar thread so people at least understand *why* they are being ignored.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #6 (permalink)  
Old July 10th, 2007, 02:49 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by SQLScott
 Hopefully, they'll figure out why they aren't getting a response.

If only it were that easy. That usually just sparks a "why aren't you experts helping me!??!" follow-up post.

<off topic but funny>
http://software.ericsink.com/entries/Urgent.html
</off topic but funny>

-Peter
Reply With Quote
  #7 (permalink)  
Old July 11th, 2007, 11:23 AM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Yes, and just one more thing. How about lending a helping hand and trying to resolve someone's problem and then we get the response, "Oh, I fixed it already", and then no solution is posted. Jeez, at least post your solution or tell us what dumb mistake you made. I make plenty and don't mind sharing them.

I know I've hijacked this "topic" but I guess all is fair in love and war. I've been lurking in the WROX forums for over five years. I stuck around cause it was the most vibrant, interesting and intelligent group around. Plus I think the WROX books are the best. I just hate to see the forums here to degenerate into the "Please help urgent emergency" sludge bucket. I've gotten so much "help" here and do try to contribute whenever possible in order to give back and help some less experienced folks get into the swing of things. I probably wouldn't have the job I have now if it weren't for this forum. I don't even mind posting code. Plenty of code was posted for me when I asked. That's how I basically learned to program, from code examples. I didn't just get class libraries and start coding.

OK. We're not helping you cause you need to do at least part of it yourself. There are tons of examples of stored procedures with input and output parameters on the Internet. I've never posted asking, "Please send me the code to query a database and attach the results to an auto-email script, emergency, help, urgent, my boss is looking over my shoulder, I got hired and I'm totally unqualified." But, I have posted queries here where I got stuck after spending hours trying to figure it out myself, including first searching the forums here to see if my topic has already been addressed. It doesn't even seem like people are even doing that anymore. I keep seeing the same posts over and over again.

Many people here have helped me immensely, including you guys who posted here on this thread. I am extremely grateful that you've given your time and energy.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slightly off topic but how do I... Ceromus BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 0 October 21st, 2008 12:16 PM
My first topic codylee C# 2008 aka C# 3.0 1 January 3rd, 2008 08:05 AM
Topic Subscriptions SerranoG Forum and Wrox.com Feedback 5 September 7th, 2005 12:22 PM
Is this topic a professional topic?? mega ASP.NET 1.0 and 1.1 Professional 0 December 3rd, 2004 09:37 PM
New Topic Problems Steven Forum and Wrox.com Feedback 2 June 25th, 2003 03:46 PM



All times are GMT -4. The time now is 08:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.