Showing posts with label compare. Show all posts
Showing posts with label compare. Show all posts

Wednesday, March 7, 2012

Different results when executing from .NET component compare to executing from SQL Managem

Hi all,

I am facing an unusual issue here. I have a stored procedure, that return different set of result when I execute it from .NET component compare to when I execute it from SQL Management Studio. But as soon as I recompile the stored procedure, both will return the same results.
This started to really annoying me, any thoughts or solution?
Thanks very much guys

I'm interested in some more details: what's the meaning of different results? Returning different data (rows)? Or same data (rows) in different orders? Can you post the stored proceudre if it does not contain too many statements?

Since recomplie the stored procedure can solve the issue, it seems SQL optimizer chooses different execution plans, thus may lead to different results. One work around is to call the stored procedure with recomplie:

EXECUTEyourSPName WITH RECOMPILE

However this is not a so good solution, as RECOMPLIE at each execution will impact SQL performance.

|||

The result that come back seems to be from the old version of the stored procedure, or could be it's joining differently.
I am suspecting that .NET SQL provider has a seperate query plan cache. The actual select statement is like this, I removed few lines in the where clause and column selections.
SELECT
main.*,fa.*
FROM [NetFare] main
INNER JOIN dbo.Agent fa
ON main.FareId = fa.FareId
LEFT OUTER JOIN travel.dbo.currencies c
ON c.Code = main.FareCurrency
Where

AND (PriceReturnType = @.ReturnType)
And main.PortSetID in (Select Distinct PortSetID
From FarePortSetMember Where PortCode = @.DestinationPort Or PortCode = @.DestinationCity)
And main.OriginPortSetId in (Select Distinct FarePortSetId
From FarePortSetMember Where PortCode = @.OriginPort Or PortCode = @.OriginCity)
AND ((DateFrom <= @.EarliestDepartureDate) AND (DateTo >= @.EarliestDepartureDate))
AND (DATEDIFF(day, TicketDateFrom,GetDate()) >= 0 AND DATEDIFF(day, TicketDateTo, getdate()) <=0)
And status in ('Active','Updating')

Option (KEEPFIXED PLAN)

I just added the OPTION (KEEPFIXED PLAN) and have been monitoring to see if the problem happens again.
So there is no fancy stuff in the query, but it seems to me that the .NET SQL provider are using different query plan.

Could MVP dudes verify this for us, please?

I am using SQL 2000 by the way and .NET 1.1 component called from ASP.NET 2.0

Saturday, February 25, 2012

Different of SQL 2000 Standard & Enterprise

Hello:
Does any URL that can compare the different between Standard & Enterprise?
Thanks!
Hi
One of many is
[url]http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032306509&EventC ategory=5&culture=en-US&CountryCode=US[/url]
"NewUser" <user@.isp.com> wrote in message
news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
> Hello:
> Does any URL that can compare the different between Standard & Enterprise?
> Thanks!
|||Hello,
In the upper layer there is no difference. But for functionality and engine
optimization there are lots of advancements in Enterprise edition.
over standard. This includes support to more than 4 CPU, Partitioning,
Online Index rebuild, ONline Restore, Fast recovery...
http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx
Thanks
Hari
"NewUser" <user@.isp.com> wrote in message
news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
> Hello:
> Does any URL that can compare the different between Standard & Enterprise?
> Thanks!
|||Hi Hari,
I think the options that you writes is for SQL 2005 and the question asks
about SQL 2000. Am i right ?
Regards,
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:eYXYtdqTHHA.4744@.TK2MSFTNGP02.phx.gbl...
> Hello,
> In the upper layer there is no difference. But for functionality and
> engine optimization there are lots of advancements in Enterprise edition.
> over standard. This includes support to more than 4 CPU, Partitioning,
> Online Index rebuild, ONline Restore, Fast recovery...
> http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx
> Thanks
> Hari
> "NewUser" <user@.isp.com> wrote in message
> news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
>
|||There is some SQL Server 2000 edition information here:
http://msdn2.microsoft.com/en-us/library/aa175266(SQL.80).aspx
Alan Brewer [MSFT]
SQL Server Documentation Team
Download the latest Books Online update:
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
This posting is provided "AS IS" with no warranties, and confers no rights.

Different of SQL 2000 Standard & Enterprise

Hello:
Does any URL that can compare the different between Standard & Enterprise?
Thanks!Hi
One of many is
http://msevents.microsoft.com/cui/W...&CountryCode=US
"NewUser" <user@.isp.com> wrote in message
news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
> Hello:
> Does any URL that can compare the different between Standard & Enterprise?
> Thanks!|||Hello,
In the upper layer there is no difference. But for functionality and engine
optimization there are lots of advancements in Enterprise edition.
over standard. This includes support to more than 4 CPU, Partitioning,
Online Index rebuild, ONline Restore, Fast recovery...
http://www.microsoft.com/sql/prodin...e-features.mspx
Thanks
Hari
"NewUser" <user@.isp.com> wrote in message
news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
> Hello:
> Does any URL that can compare the different between Standard & Enterprise?
> Thanks!|||Hi Hari,
I think the options that you writes is for SQL 2005 and the question asks
about SQL 2000. Am i right ?
Regards,
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:eYXYtdqTHHA.4744@.TK2MSFTNGP02.phx.gbl...
> Hello,
> In the upper layer there is no difference. But for functionality and
> engine optimization there are lots of advancements in Enterprise edition.
> over standard. This includes support to more than 4 CPU, Partitioning,
> Online Index rebuild, ONline Restore, Fast recovery...
> http://www.microsoft.com/sql/prodin...e-features.mspx
> Thanks
> Hari
> "NewUser" <user@.isp.com> wrote in message
> news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
>|||There is some SQL Server 2000 edition information here:
http://msdn2.microsoft.com/en-us/library/aa175266(SQL.80).aspx
Alan Brewer [MSFT]
SQL Server Documentation Team
Download the latest Books Online update:
http://www.microsoft.com/technet/pr...oads/books.mspx
This posting is provided "AS IS" with no warranties, and confers no rights.

Different of SQL 2000 Standard & Enterprise

Hello:
Does any URL that can compare the different between Standard & Enterprise?
Thanks!Hi
One of many is
http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032306509&EventCategory=5&culture=en-US&CountryCode=US
"NewUser" <user@.isp.com> wrote in message
news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
> Hello:
> Does any URL that can compare the different between Standard & Enterprise?
> Thanks!|||Hello,
In the upper layer there is no difference. But for functionality and engine
optimization there are lots of advancements in Enterprise edition.
over standard. This includes support to more than 4 CPU, Partitioning,
Online Index rebuild, ONline Restore, Fast recovery...
http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx
Thanks
Hari
"NewUser" <user@.isp.com> wrote in message
news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
> Hello:
> Does any URL that can compare the different between Standard & Enterprise?
> Thanks!|||Hi Hari,
I think the options that you writes is for SQL 2005 and the question asks
about SQL 2000. Am i right ?
Regards,
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:eYXYtdqTHHA.4744@.TK2MSFTNGP02.phx.gbl...
> Hello,
> In the upper layer there is no difference. But for functionality and
> engine optimization there are lots of advancements in Enterprise edition.
> over standard. This includes support to more than 4 CPU, Partitioning,
> Online Index rebuild, ONline Restore, Fast recovery...
> http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx
> Thanks
> Hari
> "NewUser" <user@.isp.com> wrote in message
> news:eA3p0qnTHHA.920@.TK2MSFTNGP05.phx.gbl...
>> Hello:
>> Does any URL that can compare the different between Standard &
>> Enterprise?
>> Thanks!
>|||There is some SQL Server 2000 edition information here:
http://msdn2.microsoft.com/en-us/library/aa175266(SQL.80).aspx
--
Alan Brewer [MSFT]
SQL Server Documentation Team
Download the latest Books Online update:
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
This posting is provided "AS IS" with no warranties, and confers no rights.