I am using the query below to query the data container STRFL from a SQL Serverless Pool:
-- This query format doesn't work with GRDCFG
SELECT
TOP 10 TAF_Id
FROM OPENROWSET (
'CosmosDB', N'account=ACCOUNT;database=DATABASE;region=REGION;key=PRIMARYREADONLYKEY',STRFL
) AS Docs
This query works as intended. However, when I change the container to GRDCFG, I get the following error:
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
The container GRDCFG exists in the database (the spelling of the object name is correct - literally just changed the container name in the query) so I don't understand why SQL is returning the error.
Normally, below is how I would query GRDCFG, but I would like to try the query format above (and understand why it isn't working that way):
-- This query format works with GRDCFG
SELECT TOP 10 TAF_Id
FROM OPENROWSET(
PROVIDER = 'CosmosDB',
CONNECTION = 'Account=ACCOUNT;Database=DATABASE',
OBJECT = 'GRDCFG',
SERVER_CREDENTIAL = 'CREDENTIAL'
) WITH (
TAF_Id VARCHAR(10)
) AS Data
Both are using OPENROWSET but the second query requires me to define the fields I need. In this particular use-case, I need to get the data from all the columns from the GRDCFG container without defining the fields, hence the need to use the first query format.
Anyone know what is causing this behavior?
1条答案
按热度按时间vshtjzan1#
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
The transit error generally comes for timeout or if query doesn't complete in particular time for larger dataset.
Fo this you can tr adding additional parameter timeout to the linked service.
I need to get the data from all the columns from the GRDCFG container without defining the fields.
To get all fields you can use this query in below format.