Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Backend issues... sql 2000 and sql 2005

Author  Topic 

koolkeith19
Starting Member

14 Posts

Posted - 2008-12-17 : 22:36:39
Hi There,

I have a order interface web app that connects to SQL back end.

I performed a sql 2000 to 2005 upgrade on a stand alone server and I began getting extra quotes with my calls to Store-procedures that use dates:
Here is the call from SQL Profiler (look at the startdt and enddt)

declare @p5 varchar(8000)
set @p5=''
exec OCRCMGetInvalidProductId @ProductId='',@StoreId='3-3024100',@StartDt=''2008-11-16 00:00:00:000'',@EndDt=''2008-12-27
00:00:00:000'',@output=@p5 output
select @p5


if I move the web app to point to a SQL 2000 instance on a different physical server it works...

declare @p5 varchar(8000)
set @p5=''
exec OCRCMGetInvalidProductId @ProductId='',@StoreId='3-3024100',@StartDt='2008-11-16 00:00:00:000',@EndDt='2008-12-27
00:00:00:000',@output=@p5 output
select @p5



HELP...
Is there a configurable I am missing??

THANKS!!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-17 : 23:11:58
No, you'll need to fix the code. SQL 2000 was more lenient.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

koolkeith19
Starting Member

14 Posts

Posted - 2008-12-18 : 08:29:04
quote:
Originally posted by tkizer

No, you'll need to fix the code. SQL 2000 was more lenient.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog




Are you talking about the Web app or SP?

here is the SP:
set ANSI_NULLS ON 
set QUOTED_IDENTIFIER ON
go



ALTER PROCEDURE [dbo].[OCRCMGetInvalidProductId]
(
@ProductId varchar(4000)='',
@StartDt datetime,
@EndDt datetime,
@StoreId varchar(36),
@output varchar(8000) output
)
AS

IF(LEN(@ProductId) > 0)
SELECT @output = coalesce(@output + ',' , '') + col
FROM
(
SELECT DISTINCT col
FROM
fn_OC_ProduceListFromString(@ProductId)
WHERE col NOT IN
(
SELECT DISTINCT p.ProductID
FROM tblProductAuthorization pa JOIN tblProduct p ON ppa.ProductID = p.ProductId
JOIN fn_OC_ProduceListFromString(@ProductId) pl ON p.ProductID=pl.col
WHERE pa.StoreId =@StoreId and p.ActiveFlg=1
AND
(
(@StartDt >= pa.EffectiveDt AND @StartDt <= pa.ExpirationDt)
OR
(@EndDt >= pa.EffectiveDt AND @EndDt <= pa.ExpirationDt)
)
)
) t1
ELSE
SELECT @output = '';
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2008-12-18 : 09:16:12
Can you show what is the format leaving the web app?
eg. can you put call to stored procedure, parameter values etc, from web app into a label or messagebox and show us result.
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2008-12-18 : 09:27:23
Can you run:
sp_dboption 'DBNAME'
against both databases to see if settings are different - esp quoted identifier
Go to Top of Page

koolkeith19
Starting Member

14 Posts

Posted - 2008-12-18 : 09:44:13
quote:
Originally posted by darkdusky

Can you run:
sp_dboption 'DBNAME'
against both databases to see if settings are different - esp quoted identifier



here is the result of the running sp_dboption, it is the same for both databases:

trunc. log on chkpt.
torn page detection
auto create statistics
auto update statistics
Go to Top of Page
   

- Advertisement -