|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL Execution Error: Cannot call methods on intattempt to execute the following query in SQL Server Management Studio or Visual Studio 2005 Database project an exception is thrown. SELECT CAST('2' AS INTEGER) AS Expr1 The error message says: --------------------------- Microsoft SQL Server Management Studio --------------------------- SQL Execution Error. Executed SQL statement: SELECT CAST('2' AS INTEGER).ToString() AS Expr1 Error Source: .Net SqlClient Data Provider Error Message: Cannot call methods on int. --------------------------- OK Help --------------------------- The funny thing is that if I open up good old SQL Query Analyzer it can execute it without any problems. The following query executes without any problem on Management Studio: SELECT CAST('2' AS DECIMAL) AS Expr1 So it does seem like the problem is in the .Net SqlClient Data Provider, but how to fix it? Any ideas? Thanks! (r***@rsktech.com) writes:
Show quote > I have run in to the following problem on MS SQL Server 2005: When I Funky. I was not able to repeat this. (I tried Mangement Studio only).> attempt to execute the following query in SQL Server Management Studio > or Visual Studio 2005 Database project an exception is thrown. > > SELECT CAST('2' AS INTEGER) AS Expr1 > > The error message says: > > --------------------------- > Microsoft SQL Server Management Studio > --------------------------- > SQL Execution Error. > > Executed SQL statement: SELECT CAST('2' AS INTEGER).ToString() AS Expr1 > Error Source: .Net SqlClient Data Provider > Error Message: Cannot call methods on int. Are you running this from the Query Editor? -- Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx I can repro this in the View Designer. Surely it's a bug, and I'll
report it. Steve Kass Drew University r***@rsktech.com wrote: Show quote >I have run in to the following problem on MS SQL Server 2005: When I >attempt to execute the following query in SQL Server Management Studio >or Visual Studio 2005 Database project an exception is thrown. > >SELECT CAST('2' AS INTEGER) AS Expr1 > >The error message says: > >--------------------------- >Microsoft SQL Server Management Studio >--------------------------- >SQL Execution Error. > >Executed SQL statement: SELECT CAST('2' AS INTEGER).ToString() AS Expr1 >Error Source: .Net SqlClient Data Provider >Error Message: Cannot call methods on int. >--------------------------- >OK Help >--------------------------- > >The funny thing is that if I open up good old SQL Query Analyzer it can >execute it without any problems. > >The following query executes without any problem on Management Studio: > >SELECT CAST('2' AS DECIMAL) AS Expr1 > >So it does seem like the problem is in the .Net SqlClient Data >Provider, but how to fix it? Any ideas? Thanks! > > > A workaround is to name the data type INT instead of INTEGER.
SK r***@rsktech.com wrote: Show quote >I have run in to the following problem on MS SQL Server 2005: When I >attempt to execute the following query in SQL Server Management Studio >or Visual Studio 2005 Database project an exception is thrown. > >SELECT CAST('2' AS INTEGER) AS Expr1 > >The error message says: > >--------------------------- >Microsoft SQL Server Management Studio >--------------------------- >SQL Execution Error. > >Executed SQL statement: SELECT CAST('2' AS INTEGER).ToString() AS Expr1 >Error Source: .Net SqlClient Data Provider >Error Message: Cannot call methods on int. >--------------------------- >OK Help >--------------------------- > >The funny thing is that if I open up good old SQL Query Analyzer it can >execute it without any problems. > >The following query executes without any problem on Management Studio: > >SELECT CAST('2' AS DECIMAL) AS Expr1 > >So it does seem like the problem is in the .Net SqlClient Data >Provider, but how to fix it? Any ideas? Thanks! > > >
Other interesting topics
|
|||||||||||||||||||||||