473,379 Members | 1,302 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,379 software developers and data experts.

stored procedure

I am trying to store the turn out of a stored procedure in a temporary
table to make filters. I do it of the following way:

SELECT a.*
FROM OPENROWSET('SQLOLEDB', 'servidor';'user';'pwd' , 'EXEC
VERT_PERIODOS_CCV
''07/06/2003'',''31/12/2003'',''49'','''',''1'','''','''',''''') AS a

but it gives back the following error to me:

Servidor: mensaje 7357, nivel 16, estado 2, línea 1
No se puede procesar el objeto 'EXEC VERT_PERIODOS_CCV
'07/06/2003','31/12/2003','49','','1','','','''. El proveedor OLE DB
'SQLOLEDB' indica que el objeto no tiene columnas.
Traza de error de OLE DB [Non-interface error: OLE DB provider unable to
process object, since the object has no columnsProviderName='SQLOLEDB',
Query=EXEC VERT_PERIODOS_CCV
'07/06/2003','31/12/2003','49','','1','','','''].

Somebody knows why?

Thanks

Mónica


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Jul 20 '05 #1
1 2379
[posted and mailed, please reply in news]

Mónica (mv******@hotmail.com) writes:
I am trying to store the turn out of a stored procedure in a temporary
table to make filters. I do it of the following way:

SELECT a.*
FROM OPENROWSET('SQLOLEDB', 'servidor';'user';'pwd' , 'EXEC
VERT_PERIODOS_CCV
''07/06/2003'',''31/12/2003'',''49'','''',''1'','''','''',''''') AS a

but it gives back the following error to me:

Servidor: mensaje 7357, nivel 16, estado 2, línea 1
No se puede procesar el objeto 'EXEC VERT_PERIODOS_CCV
'07/06/2003','31/12/2003','49','','1','','','''. El proveedor OLE DB
'SQLOLEDB' indica que el objeto no tiene columnas.
Traza de error de OLE DB [Non-interface error: OLE DB provider unable to
process object, since the object has no columnsProviderName='SQLOLEDB',
Query=EXEC VERT_PERIODOS_CCV
'07/06/2003','31/12/2003','49','','1','','','''].

Somebody knows why?


When you run a query through OPENROWSET or OPENQUERY, the query is in
fact run twice. First SQLOLEDB runs it with SET FMTONLY ON to detect
any results sets from the query, after which SQLOLEDB runs the query
with SET FMTONLY to actually execute it. In the mode FMTONLY ON, SQL
Server does not execute the statements, but just sifts through them
to find the result sets.

Unfortunately there are situations when SQL Server does not find any
result sets, and the most typical is when you create a temp table in
the procedure. Since the procedure is created in NOEXEC mode, the
table is not created, so there you go.

One way to cirumvent this is to use a table variable instead. This
should work, although I cannot recall whether I actually tested it.

You can also fool SQLOLEDB by adding SET FMTONLY OFF first to
the remote statement, but notice that this means that the procedure
is actually executed twice.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

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

Similar topics

3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
3
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
4
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the...
8
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
3
by: kd | last post by:
Hi All, How to debug a stored procedure? Thanks, kd
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
2
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.