Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

SQL COUNT(*) problem

ilan_milan_m Member Posts: 1
I am preforming a simple query:

SELECT COUNT(*) FROM MyTable

The query fails when it's preformed on sql server and succeeds when sent to an Oracle database.
The Error code is: -2147217887
The Error description is:
"Database Error: Microsoft OLE DB Provider for Sql Server, Multiple-step OLE DB operation generated errors. Check each OLE DB s"

What could be the problem ?
Are there any special settings for the database (indexes or identities) that are critical for a SELECT querys that contain the COUNT function ?

Comments

  • ToniStorhannusToniStorhannus Member Posts: 6
    : I am preforming a simple query:
    :
    : SELECT COUNT(*) FROM MyTable
    :
    : The query fails when it's preformed on sql server and succeeds when sent to an Oracle database.
    : The Error code is: -2147217887
    : The Error description is:
    : "Database Error: Microsoft OLE DB Provider for Sql Server, Multiple-step OLE DB operation generated errors. Check each OLE DB s"
    :
    : What could be the problem ?
    : Are there any special settings for the database (indexes or identities) that are critical for a SELECT querys that contain the COUNT function ?

    You could maybe allready have your answer but anyway.
    You propably should add some field on your query which actually presents in your table. I am not sure but that feels logical to me.
    like: SELECT yourfielf, COUNT(*) FROM MyTable
    Best regards
    Toni Storhannus
    :

  • infidelinfidel Member Posts: 2,900
    : You could maybe allready have your answer but anyway.
    : You propably should add some field on your query which actually presents in your table. I am not sure but that feels logical to me.
    : like: SELECT yourfielf, COUNT(*) FROM MyTable

    This statement will cause an error unless you "GROUP BY yourfielf"
    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • Justin BibJustin Bib USAMember Posts: 0

    _________ { http://forcoder.org } free ebooks and video tutorials about \ Swift, MATLAB, Objective-C, PHP, Perl, Python, Java, C++, Go, PL/SQL, Ruby, JavaScript, C, Delphi, Visual Basic, Scratch, C#, Assembly, Visual Basic .NET, R ML, Prolog, Apex, Scheme, Alice, Lisp, Logo, D, Clojure, VBScript, Lua, Dart, FoxPro, Bash, Awk, Transact-SQL, Scala, Hack, Kotlin, Crystal, Julia, SAS, ABAP, F#, Rust, Erlang, Ada, Fortran, COBOL, LabVIEW \ ______________

Sign In or Register to comment.