ข้ามไปที่เนื้อหาหลัก
Windows Dev Center
ลงชื่อเข้าใช้

 locked
Cannot call methods on bigint RRS feed

  • คำถาม

  • Hi,

    I'm getting the error 'Cannot call methods on bigint' when executing a query in Management Studio.

    It's happened after in a where clause I used a field(docmentid) of bigint data type to compare with a number

    select * from table where documentid = 432

    Thanks!

     

    13 สิงหาคม 2563 15:39

ตอบทั้งหมด

  • Hi,

    I'm getting the error 'Cannot call methods on bigint' when executing a query in Management Studio.

    It's happened after in a where clause I used a field(docmentid) of bigint data type to compare with a number

    select * from table where documentid = 432



    The next sample seems to work (in Management Studio v18.6, SQL Server 2019):

    declare @table table ( documentid bigint )

    insert into @table values ( 432 )

    select * from @table where documentid = 432

    If possible, show a sample or detail that does not work.




    • แก้ไขโดย Viorel_MVP 13 สิงหาคม 2563 16:16
    13 สิงหาคม 2563 16:14
  • I'm getting the error 'Cannot call methods on bigint' when executing a query in Management Studio.

    It's happened after in a where clause I used a field(docmentid) of bigint data type to compare with a number

    select * from table where documentid = 432

    Next time you ask a question like this, verify that the statement you include actually produces the error you get. Hey, if you make this effort, you may even spot the error yourself!

    This particular error typically appears when you have added a dot where you shouldn't. Here is an example:

    DECLARE @d bigint
    SELECT @d.ddd


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    13 สิงหาคม 2563 21:42
  • Hi Andrey1973,

    I also tested the select * from table where documentid(BIGINT) = 432 statement and it works normally.

    I found a similar issue, there are some solutions that might help you:“Cannot call methods on BIGINT” error

    If this doesn't solve your problem,please share us  your table structure (CREATE TABLE …) and some sample data(INSERT INTO …)along with your expected result? So that we’ll get a right direction and make some test.

    Best Regards
    Echo

    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.



    • แก้ไขโดย Echo Liuz 14 สิงหาคม 2563 3:08
    14 สิงหาคม 2563 3:06
  • Hi Andrey1973,

    Has your problem been solved? If it is solved, please mark the point that you 
    think is helpful as an answer. This can help others who encounter similar problems.

    Best Regards 
    Echo   



    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • เสนอเป็นคำตอบโดย Echo Liuz 20 สิงหาคม 2563 1:07
    17 สิงหาคม 2563 6:03