Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select count not the same from Web and SSMS
Message
 
 
To
18/03/2015 09:03:31
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01616928
Message ID:
01616930
Views:
37
>I have a select like this:
>
>
>DECLARE @NoClient Int
>DECLARE @Tax Float
>DECLARE @NoStatus Int
>DECLARE @NoStatus2 Int
>DECLARE @AddDate DateTime
>
>SET @NoClient=2087603
>SET @Tax=1
>SET @NoStatus=7
>SET @NoStatus2=8
>SET @AddDate='2014-10-01 15:29:59'
>
>SELECT Invoice.Numero
> FROM Invoice (NOLOCK)
> WHERE Invoice.NoClient=@NoClient AND Invoice.Tax=@Tax AND
>  Invoice.NoStatus<>@NoStatus AND Invoice.NoStatus<>@NoStatus2 AND
>  Invoice.AddDate>@AddDate
>
>
>From IIS and ASP.NET, this returns 0 record. From SSMS, it returns 1 record.
>
>Can someone tell me what could be a setting factor here that could make IIS and ASP.NET not able to find the record?

Well, if you remove NOLOCK hint you should get 1 row from all applications.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform