Asked by:
Cannot call methods on bigint

Question
-
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!
Thursday, August 13, 2020 3:39 PM
All replies
-
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.
- Edited by Viorel_MVP Thursday, August 13, 2020 4:16 PM
Thursday, August 13, 2020 4:14 PM -
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 = 432Next 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.dddErland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Thursday, August 13, 2020 9:42 PM -
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.
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.
- Edited by Echo Liuz Friday, August 14, 2020 3:08 AM
Friday, August 14, 2020 3:06 AM -
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.- Proposed as answer by Echo Liuz Thursday, August 20, 2020 1:07 AM
Monday, August 17, 2020 6:03 AM