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.
Author |
Topic |
Outrider
Starting Member
2 Posts |
Posted - 2008-07-14 : 15:40:57
|
I've got a problem with my stored procedures that I'm hoping someone can help me with.I'm trying to select information from a table which has an Identity as a primary key (ShipperID), another unique integer which the office staff uses to identify the record (ShipperNo), and a bunch of information that doesn't matter in this situation.I've written 2 stored procedures to select a record.Here's the first, which searches by ShipperID:CREATE PROCEDURE ShipperSelectByID@ShipperID intASBEGINSELECT * FROM tblShipper WHERE ShipperID = @ShipperIDENDGOAnd here's the second, which searches by ShipperNoCREATE PROCEDURE dbo.ShipperSelectByNo(@ShipperNo int)ASBEGINSELECT * FROM tblShipper WHERE ShipperNo = @ShipperNoENDGOThe problem is that they both select by ShipperID, even tho the second clearly says WHERE ShipperNo = @ShipperNo. Can anyone see something I'm missing? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-07-14 : 15:50:30
|
The first one is filtering via ShipperID, the second one is filtering via ShipperNo. If you aren't seeing this, then you aren't calling the correct stored procedure. Run the stored procedures inside Query Analyzer to see what they do.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
Outrider
Starting Member
2 Posts |
Posted - 2008-07-15 : 07:42:45
|
Turns out it was just stupidity on my part, problem wasn't even in SQL, sorry for wasting everyone's time. |
 |
|
|
|
|