Re: Problem with Stored Procedure that conatins several select statements

Tech-Archive recommends: Fix windows errors by optimizing your registry



I found the source of the problem. The select staments were run against a
linked server as I mentioned.
The Problem was that DTC was not enabled on the other machine. As soon as I
enabled it the schemas was generated properly.
The strange thing to me was that it worked when executing the sp manually
(Query Analzer) and that it created the correct schema information.

Regards,
Elias

"Elias Goetz" <elias.goetz@xxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:eTzNGnB$HHA.3780@xxxxxxxxxxxxxxxxxxxxxxx
yes, the return values seem correct. the code in my last post were just
examples.

Here is the output from the stored proc (I just replaced the names of the
columns and values):

<Schema name="Schema17" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="ReturnedValues" content="empty" model="closed">
<AttributeType name="col1" dt:type="string" />
<AttributeType name="col2" dt:type="string" />
<attribute type="col1" />
<attribute type="col2" />
</ElementType>
</Schema>
<ReturnedValues xmlns="x-schema:#Schema17" col1="value1" col2="value2" />

It looks ok to me...

I also tried setting nocount on at the first two select statements and
then off at the last one, but it didn't make a difference.

Regards,
Elias


"Leonid Ganeline" <leo_gan_57@xxxxxxxxxxx> schrieb im Newsbeitrag
news:OKAz%23D7%23HHA.4732@xxxxxxxxxxxxxxxxxxxxxxx
If you test the stored procedures from the SQL Analyser, does it output
the schema as it should?
Seems it returns only one value.

--
Regards,

Leonid Ganeline [BizTalk MVP]
http://geekswithblogs.net/leonidganeline/


"Elias Goetz" <elias.goetz@xxxxxxxxxxxxxx> wrote in message
news:OKkbSN6%23HHA.4828@xxxxxxxxxxxxxxxxxxxxxxx
I created a stored procedure that gets a nvarchar value passed. With that
value I do two lookups against a database (on a linked server).
For example:
DECLARE @var1
SET @var 1 = (SELECT colX FROM SomeOtherTable WHERE colY = @passedValue)

At the end I insert the values (that I stored in temporary variables)
into a temporary table.
The select statement for the SQL Adapter looks like "SELECT col1, col2
TOP 1 FROM @temptable FOR XML AUTO, XMLDATA".

The Problem is that everytime I create a generated schema there is only
one element in the response node called "Success" and not the two
columns in the select statement. Now if I remove the queries I mentioned
before the final SELECT then the response elements are created as I
expected.

Why does the schema generator behave this way? Is it possible to use
multiple select statements in a stored procedure where only one is used
in combination with "XML AUTO ..."?

Regards
Elias







.



Relevant Pages

  • Re: Problem with Stored Procedure that conatins several select statements
    ... TOP 1 FROM @temptable FOR XML AUTO, ... The Problem is that everytime I create a generated schema there is only ... one element in the response node called "Success" and not the two columns ... the final SELECT then the response elements are created as I expected. ...
    (microsoft.public.biztalk.general)
  • Re: Problem with Stored Procedure that conatins several select statements
    ... If you test the stored procedures from the SQL Analyser, ... The Problem is that everytime I create a generated schema there is only ... one element in the response node called "Success" and not the two columns ... the final SELECT then the response elements are created as I expected. ...
    (microsoft.public.biztalk.general)
  • Re: Linked to dbfs with VFP ODBC Driver - how reference tables?
    ... Identifying a Data Source Using a Linked Server Name ... catalog Catalog in the OLE DB data source that contains the object ... schema Schema in the catalog that contains the object ...
    (microsoft.public.sqlserver.programming)
  • Re: Determining Fully Qualified Name for Linked Servers
    ... would have catalogs but no database. ... MSDN states the fully qualified name for a Linked Server ... >The question is where do I find the catalog and schema names? ...
    (microsoft.public.sqlserver.connect)
  • Re: Add Informix linked server
    ... I think you can change the linked server name with sp_setnetname. ... > Invalid use of schema and/or catalog for OLE DB provider 'MSDASQL'. ...
    (microsoft.public.sqlserver.connect)