Skip to main content
Solved

sql statement

  • September 10, 2015
  • 4 replies
  • 146 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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

  • Author
  • 3 replies
  • 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
  • 8394 replies
  • 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
  • 3 replies
  • September 11, 2015
Hi, David:

 

 

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

fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • 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.