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
 Transact-SQL (2005)
 SQL 2005 adding extra single quote around dates???

Author  Topic 

shabazz5th
Starting Member

13 Posts

Posted - 2009-01-28 : 10:46:28
Hey Guys,

We have a web app that runs a stored procedure. In SQL 2000 it works like a charm.

But when we upgrade to 2005, it throws an extra single quote around the dates:

declare @p10 int
set @p10=97
exec OCRCMOrdersByStoreOnlyOrders_s @StoreId='3-3024100',@ProductList='',@StartDt=' '2008-11-16 00:00:00:000' ',@EndDt=' '2008-12-27 00:00:00:000' ',@ItemsPerPage=128,@CurrentPageIndex=1,@BeginPageIndex=-1,@EndPageIndex=-1,@CultureCd='en-US',@Count=@p10 output
select @p10

Like I said, in 2000 it works perfect.

The regional settings are fine (Canada)

We are running SQL2005 sp2

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-28 : 11:18:41
How did you upgrade?
Go to Top of Page

shabazz5th
Starting Member

13 Posts

Posted - 2009-01-28 : 11:57:12
quote:
Originally posted by sodeep

How did you upgrade?



Hey sodeep, thanks for replying.

We performed an upgrade. Is that an issue?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-28 : 12:01:32
I am asking 'HOW'? What happens if you put compatability to 80?
Go to Top of Page

shabazz5th
Starting Member

13 Posts

Posted - 2009-01-28 : 12:05:08
quote:
Originally posted by sodeep

I am asking 'HOW'? What happens if you put compatability to 80?



How? We have a server, it was 2000, we upgraded it to 2005. I guess I'm missing something in your question.

As for compatibility, what does that mean? Is there an option to set it to 80?
Go to Top of Page

revdnrdy
Posting Yak Master

220 Posts

Posted - 2009-01-28 : 12:13:24
quote:
Originally posted by shabazz5th

quote:
Originally posted by sodeep

I am asking 'HOW'? What happens if you put compatability to 80?



How? We have a server, it was 2000, we upgraded it to 2005. I guess I'm missing something in your question.

As for compatibility, what does that mean? Is there an option to set it to 80?



Yes you simply go to the database properties and look under the options setting. You can change the compatibility mode there

r&r
Go to Top of Page

shabazz5th
Starting Member

13 Posts

Posted - 2009-01-28 : 12:34:48
quote:
Originally posted by revdnrdy

quote:
Originally posted by shabazz5th

quote:
Originally posted by sodeep

I am asking 'HOW'? What happens if you put compatability to 80?



How? We have a server, it was 2000, we upgraded it to 2005. I guess I'm missing something in your question.

As for compatibility, what does that mean? Is there an option to set it to 80?



Yes you simply go to the database properties and look under the options setting. You can change the compatibility mode there

r&r



I see, yes, it is set to 80 (SQL 2000) compatible
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-28 : 12:37:12
then change it to 90

EXEC sp_dbcmptlevel yourdbname,90
Go to Top of Page

koolkeith19
Starting Member

14 Posts

Posted - 2009-01-28 : 12:38:53
Shabazz I think you need to set your options to EAD
Go to Top of Page

revdnrdy
Posting Yak Master

220 Posts

Posted - 2009-01-28 : 12:40:28
In case your interested..

Here is a website that lists the differences between the compatibility modes. It was taken from BOL (Books Online) and reproduced.
[url]http://geekswithblogs.net/influent1/archive/2007/01/04/102774.aspx[/url]

hope that helps !

r&R

Go to Top of Page

shabazz5th
Starting Member

13 Posts

Posted - 2009-01-28 : 12:42:37
quote:
Originally posted by visakh16

then change it to 90

EXEC sp_dbcmptlevel yourdbname,90




OK, will do...will post results back here shortly.

Thx,
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-28 : 12:45:17
ok...cheers
Go to Top of Page

shabazz5th
Starting Member

13 Posts

Posted - 2009-01-28 : 12:59:44
quote:
Originally posted by visakh16

ok...cheers



It WORKED! Thanks guys!!!!!!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-28 : 13:04:56
Cheers
Go to Top of Page
   

- Advertisement -