[SQL Server] remote connection problems and notes

Source: Internet
Author: User
Tags ole

-- 1 query timeout

 

SelectCommentid, generalid, nodeid, topicid, commenttitleFrom OpenDataSource(
'Sqloledb',
'Data Source = 111.68.9.50; user id = sq_zhqlzzf; Password = 123456'
). Sq_zhqlzzf.dbo.pe_comment

/*
The ole db access interface "sqlncli" of the linked server "(null)" returns the message "Logon timeout expired ".
An error occurred while connecting to the ole db access interface "sqlncli" of the "(null)" server "to return the message" Establishing a connection to the server. When you connect to SQL Server 2005, the fact that SQL server does not allow remote connection by default may cause failure. ".
Message 53, level 16, status 1, 0th rows
Named Pipe provisionProgram: Unable to open connection with SQL Server [53].

*/

 

 

In this case, the timeout parameter should be added, and timeout = 0 will wait indefinitely, so that even if the server fails to write an error or other issues, it will always wait. Therefore, we do not recommend that you use timeout = 0.

 

SelectCommentid, generalid, nodeid, topicid, commenttitleFrom OpenDataSource(
'Sqloledb',
'Data Source = 111.68.9.50; user id = sq_zhqlzzf; Password = 123456; timeout = 180'
). Sq_zhqlzzf.dbo.pe_comment

/*
Commentid generalid nodeid topicid commenttitle
-----------------------------------------------------------
1 75 7 1 OK
2 75 7 1 fill
3 75 7 1
4 77 7 1 faster
5 77 7 1 ASDF
6 99 7 1 ASDFASDF
7 99 7 1 ASDFASDF

(7 rows affected)

*/

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.