174
Views
8
Comments
SQL Command - Can't find server 'XXXXX'
Question

Hello,

I tried to write a sql command but face the error.

Error in advanced query SQL1: Could not find server' XXXXXX' in sys.servers.

Verify that the correct server name....

Could someone help it. Thanks a lot. 


sql.gif
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Howard,

Are you explicitly specifying a server, or is that database the default OutSystems database?

UserImage.jpg
Howard Hua

I use for default outsystems database. 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

And everything else works fine? Like publishing, Aggregates etc.?

UserImage.jpg
Howard Hua

Yes, only when i do test command will face the error. 

2023-12-07 07-51-40
Remco Dekkinga
 
MVP

Can you show the query you are trying to run? It seems that there is an error in the way you write your query.

UserImage.jpg
Howard Hua

The command as below


SELECT max({StockRequisitionHeader}.[SerialNumber]) from {StockRequisitionHeader}.[SerialNumber]
where {StockRequisitionHeader}.[SerialNumber] is not null

2020-06-16 09-15-44
Vasilii Migunov

Hi Howard.

The problem is in your query:
from {StockRequisitionHeader}.[SerialNumber]

Just remove [SerialNumber] here.

OutSystems converts your original query to something like that:
from  [DB_NAME].DBO.[OSUSR_STOCKREQUISITIONHEADER].[SERIALNUMBER]
In that case SQL server thinks that [DB_NAME] is a server name, that's why you get Could not find server error.

2020-05-29 14-07-58
Rajendra Singh

Hi Howard Hua

Vasily is right,  In From Clause you should use only the table name. Just Remove the .[SerialNumber] it will work.



Thanks

RAj



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.