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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Question about SP

Author  Topic 

shifis
Posting Yak Master

157 Posts

Posted - 2006-04-07 : 19:56:28
Hi!
I have the next query, ( is an example, not a real statement), how can I do to make this query to return the las statement has a result in my Visual basic applycation?

Actually it returns me the result of "select * from rh_ubicacion"


CREATE PROCEDURE spEjemploTere
@intPuesto int,
@intEmpresa int
AS
set nocount on

select * from rh_ubicacion

SELECT dbo.RH_TRAB.CLA_TRAB, dbo.RH_TRAB.NOM_TRAB, dbo.RH_TRAB.AP_PATERNO, dbo.RH_TRAB.AP_MATERNO,
dbo.RH_UBICACION.NOM_UBICACION, dbo.RH_TRAB.CLA_PUESTO
FROM dbo.RH_UBICACION INNER JOIN
dbo.RH_TRAB ON dbo.RH_UBICACION.CLA_EMPRESA = dbo.RH_TRAB.CLA_EMPRESA AND
dbo.RH_UBICACION.CLA_UBICACION = dbo.RH_TRAB.CLA_UBICACION_BASE
WHERE (dbo.RH_TRAB.CLA_PUESTO = @intPuesto) AND (dbo.RH_TRAB.CLA_EMPRESA = @intEmpresa)


GO

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-07 : 22:19:59
mask off the "select * from rh_ubicacion" statement



KH


Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-10 : 02:57:15
or

set Rs=Rs.NextRecordSet
where Rs as Recordset, then you can access second resultset


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

shifis
Posting Yak Master

157 Posts

Posted - 2006-04-10 : 13:53:10
Thanks!

How do I mask off the "select * from rh_ubicacion" statement?

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-04-10 : 14:12:12
If this is VB.NET, you can store the results of the stored procedure into a data set. You would have two data tables in your data set. DataSet(0) would have the results from the first select, DataSet(1) would have the results from the second select.

Tara Kizer
aka tduggan
Go to Top of Page

shifis
Posting Yak Master

157 Posts

Posted - 2006-04-10 : 14:43:35
I'm using VB6.0
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-04-10 : 14:55:52
Then you can ignore my reply.

Tara Kizer
aka tduggan
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-04-10 : 21:03:43
if you don't need this
quote:

select * from rh_ubicacion



just delete it so you'll only get one resultset

--------------------
keeping it simple...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-11 : 01:10:16
quote:
Originally posted by shifis

I'm using VB6.0


Didnt you read my first reply?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -