Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SP -> Temp table 1

Status
Not open for further replies.

Niv3k

Programmer
Jul 11, 2001
350
US
I have a table with IP Addresses stored as a BigInt. This is for 'natural' ordering. I also wrote a stored procedure that allows a user to search by IP's in the format of x.x.x.x where x is a number from 0-255 or a *, for a wildcard. I want to link this SP in a query.

Here is my layout:
Code:
t_Routers
   DeviceID   (PK, one to many)
   blah
   blah

t_Interfaces
   DeviceID   (FK to t_Routers) 
   IF_ID
   IP_Address[code]

I need to pull DeviceID, blah, blah from t_Routers where the IP Address is = to the result of my SP.  If it's important, the front-end is ASP.

Please help and thanks in advance,
Kevin
 
Hi Niv3k,
If you are using SQL 2K, then you can covert your SP to a function which further can be used in the SELECT query.
Otherwise you have to make change in your SP to send an OUTPUT parameter (ip values) which further can be used in a SELECT statement in where clause.

 
I am using SQL2k, and that's what I ended up doing. It's not exactly what I wanted to do, but I've run several tests now, and at least the front end is acting as I had envisioned. Thanx!

Kevin

PS - I'm keeping the stored procedure around, though, just cause it's cool!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top