Skip to main content
Solved

sql statement

  • September 10, 2015
  • 4 replies
  • 111 views

Hi, all:

 

 

I have a huge MS SQL Server Non-spatial database,each record has a "datetime" time stamp. Now I'm using "SQLCreator" to read the data.

 

In the SQL Statement, I wrote:

 

 

SELECT * FROM mytable

 

WHERE  ID='1007'

 

AND YEAR(datetime)=2015

 

AND MONTH(datetime)=1

 

 

But I cannot get the data and FME say: MS SQL Server Reader: Query failed, possibly due to a malformed statement. Provider error `(-2147217871) Query timeout expired'

 

 

 

Does anyone know the reason?

 

 

Thanks in advance,

 

Ariel

 

 

Best answer by fmelizard

FME will set a timeout value by default. If you are encountering this error, you set the Command Timeout to 0 so there is no timeout.

View original
Did this help you find an answer to your question?

4 replies

  • Author
  • September 10, 2015
I think myself find the method, I used Command Timeout as '9999999" but after change that to 300 seconds, it works. :)

david_r
Celebrity
  • September 11, 2015
Hi

 

 

You might want to verify that your fields ID and DATETIME have been properly indexed, it shouldn't take many seconds to run a query like this.

 

 

David

  • Author
  • September 11, 2015
Hi, David:

 

 

Thanks, yes they are properly indexed. I got it running now. 

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • September 12, 2017

FME will set a timeout value by default. If you are encountering this error, you set the Command Timeout to 0 so there is no timeout.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings