Recently done a small test site, where there is a page, the page load need to calculate a number of
There is a row of SQL statements,
Select SUM (FileSize) from [File] where [email protected], everything is OK during native testing
But did not expect is because of this sentence SQL statement, tossing the afternoon, the machine vs2012+sqlserver2008
When you deploy to the server, you always get an error when you go to this page
Check the good information, before returning may be due to the SQL Server version
Finally, find a workaround: Replace the SQL statement with the following:
Select IsNull (SUM (isnull (FileSize, 0)), 0) from [File] where [email protected]
Each step is judged to be empty
Because SQL Server version is too low, some features do not support, it will cause a variety of inexplicable errors
Put it in here and share it with you.
Beginners are not easy, I hope you master a lot of guidance
About the null judgment problem in different versions of SQL Server