473,394 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

getting info from temp table

My Stored
************************************************** *******
CREATE PROCEDURE st_seconddegree
@fromwhom numeric(18), @towhom numeric(18) AS
if not exists (select 1 from crosstable where (fromwhom=@fromwhom and
towhom=@towhom ) or (fromwhom=@towhom and towhom=@fromwhom))
Begin
create table #pele1
(xuserid numeric(18),xarkid numeric (18)
)
insert into #pele1 SELECT
xuserid = CASE WHEN fromwhom <> @fromwhom then @fromwhom ELSE fromwhom
END,
xarkid = CASE WHEN fromwhom = @fromwhom then towhom ELSE fromwhom END
FROM crosstable
where fromwhom=@fromwhom or towhom=@fromwhom
create table #pele2
(xuserid numeric(18),xarkid numeric (18)
)
insert into #pele2
SELECT
xuserid = CASE WHEN fromwhom <> @towhom then @towhom ELSE fromwhom END,
xarkid = CASE WHEN fromwhom = @towhom then towhom ELSE fromwhom END
FROM crosstable
where fromwhom=@towhom or towhom=@towhom

select #pele1.xarkid as xarkid from #pele1 INNER JOIN #pele2 ON
#pele1.xarkid=#pele2.xarkid;
drop table #pele1
drop table #pele2
End
GO
************************************************** *******
in asp

set rs=baglantim.execute ("st_seconddegree @fromwhom='10',@towhom='7'")
response.write rs("xarkid")

error is
ADODB.Recordset (0x800A0CC1) Item cannot
be found in the collection corresponding to the requested name or ordinal

I TRIED
exec st_seconddegree @fromwhom='10',@towhom='7' in Sql query analyser
it returns me xarkid=2
it works..

but in asp it doesnt works.. i thimk it is about temp table field name or
Drop temp table..
how can it works in asp?



Jul 19 '05 #1
3 1396
You could try adding SET NOCOUNT ON in the beginning of your proc code...

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Savas Ates" <sa***@indexinteractive.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
My Stored
************************************************** *******
CREATE PROCEDURE st_seconddegree
@fromwhom numeric(18), @towhom numeric(18) AS
if not exists (select 1 from crosstable where (fromwhom=@fromwhom and
towhom=@towhom ) or (fromwhom=@towhom and towhom=@fromwhom))
Begin
create table #pele1
(xuserid numeric(18),xarkid numeric (18)
)
insert into #pele1 SELECT
xuserid = CASE WHEN fromwhom <> @fromwhom then @fromwhom ELSE fromwhom
END,
xarkid = CASE WHEN fromwhom = @fromwhom then towhom ELSE fromwhom END
FROM crosstable
where fromwhom=@fromwhom or towhom=@fromwhom
create table #pele2
(xuserid numeric(18),xarkid numeric (18)
)
insert into #pele2
SELECT
xuserid = CASE WHEN fromwhom <> @towhom then @towhom ELSE fromwhom END,
xarkid = CASE WHEN fromwhom = @towhom then towhom ELSE fromwhom END
FROM crosstable
where fromwhom=@towhom or towhom=@towhom

select #pele1.xarkid as xarkid from #pele1 INNER JOIN #pele2 ON
#pele1.xarkid=#pele2.xarkid;
drop table #pele1
drop table #pele2
End
GO
************************************************** *******
in asp

set rs=baglantim.execute ("st_seconddegree @fromwhom='10',@towhom='7'")
response.write rs("xarkid")

error is
ADODB.Recordset (0x800A0CC1) Item cannot
be found in the collection corresponding to the requested name or ordinal

I TRIED
exec st_seconddegree @fromwhom='10',@towhom='7' in Sql query analyser
it returns me xarkid=2
it works..

but in asp it doesnt works.. i thimk it is about temp table field name or
Drop temp table..
how can it works in asp?


Jul 19 '05 #2
thanks
what is the function of this command
SET NOCOUNT ON
Jul 19 '05 #3
It makes SQL Server not return the "rows affected" message after each DML operation. ADO treats this
as a closed recordset...

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Savas Ates" <sa***@indexinteractive.com> wrote in message
news:eh*************@TK2MSFTNGP11.phx.gbl...
thanks
what is the function of this command
SET NOCOUNT ON

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rick | last post by:
I want to get a resultset of every table in the database, with the current record count of each. What is the easiest way to do this? I can get the list of tables with: Select s.name from...
1
by: WIWA | last post by:
Hello, I have written a program that gets information from Active Directory. This is the function I'm using: void ADSysGetUserName(IADsADSystemInfo * pSys, char * data) { HRESULT hr; BSTR...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
2
by: Joe | last post by:
Hi All, I am new to using the Access DB and I need some help if someone is able to give it to me. What I want to do is get the names of the columns of certain tables. Not the data in the table...
9
by: Freebird | last post by:
Hello everyone ... I've a problem in here, I need to make a 70 000 rows insert, and it's taking a lot more than 30 seconds, my problem is that it will be a script that will work in many...
1
by: FLX | last post by:
Hello, I'm trying to scrape daily titles from http://www.doopes.com/?cat=35444&lang=1&num=5&mode=0&from=2007-09-04&to=2007-09-04&exc=&inc=&opt=0 But i'm getting lost using preg_match. Can someone...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
3
praclarush
by: praclarush | last post by:
I'm trying to Update one table with info from another table this is the query that I'm using UPDATE Formula INNER JOIN TempFormulas ON Formula.FormulaID = TempFormulas.FormulaID SET...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.