Showing posts with label local. Show all posts
Showing posts with label local. Show all posts

Friday, March 9, 2012

Inconsistent Linked Server Query Results

Hello,

I have a linked server named 'Charlie_File' to an Excel Workbook that I set up in SQLServer 2005 Management Studio. The workbook is on my local C drive. Sometimes, I get the results back that I expect when I run the following query;

SELECT*FROMOPENQUERY(Charlie_file,'SELECT * FROM [Feb$]')

Sometimes, on subsequent runs of the above query, I get the following message;

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "Charlie_file" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "Charlie_file".

There seems to be about a minute or so of a delay before the query will run correctly on subsequent attempts. Is there a connection issue here where a connection blocks subsequent attempts to select the data within a specific time span?

Thank you for your help!

cdun2

It turns out that the problem was with security settings on the linked server. I didn't have a mapping set up between the linked server and the SQL Server login for myself, so under 'For a login not defined in the list above, connections will;' I selected 'Be made using the login's current security context.'

cdun2

Inconsistand execution of SISS Package

Hi

Can someone please help?

I have a small package that makes an OLDB connection to my local 2005 SQL server then does some processing and places the results in a text file as XML

I have created a stored proc that uses xp_cmdshell to call the package and pass a paramter to it.

It all works fine when I call it from the command line or execute the stored proc from SQL Management Studio or if I call it as part of a SQL Agent job, but when it is called from C# from an ASP page then it fails with a timeout error.

Even stanger is the fact that when there is no data there for it to process it runs OK so I dont think it is permissions but the size of the output file only has to be a couple of k for it to fail from the ASP page.

If we comment out some of the functions in the package then it will execute OK from ASP

Help Whats going on ?

Got a work around for it at the moment. I created an agent job which starts the package then used sp_start_job in my application to start the job and hence the package and it all works OK

Would like to know why I cant get it to work directly from the application though

Cheers

Sunday, February 19, 2012

In TSQL how to use OPENXML to open an ntext field in a table? I can not read the ntext int

In TSQL how to use OPENXML to open an ntext field in a table? I can not read
the ntext into a local var as TSQL does not allowe ntext local variables.Already answered elsewhere...
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Daniel" <softwareengineer98037@.yahoo.com> wrote in message
news:eR%23c5xVLGHA.2320@.TK2MSFTNGP11.phx.gbl...
> In TSQL how to use OPENXML to open an ntext field in a table? I can not
> read
> the ntext into a local var as TSQL does not allowe ntext local variables.
>