You are here: Re: Datatype-convertion in TSQL « MsSQL Server « IT news, forums, messages
Re: Datatype-convertion in TSQL

Posted by Filips Benoit on 06/21/06 20:35

Thank for following me,

I'm still not done with that date-convertion-problem

I want to be able to run the SP below but it triggers error = 'Aritmitic
overflow error converting expression to data type datetime'

What am i missing.

Thanks²,

Filip



Alter Procedure StoredProcedure1

-- dates in CPROP_VALUE ( nvarchar) as '1/1/2000' or'01/01/200' or
'1/06/2000' tested in access with function IsDate()

As

SELECT CPROP_PRP_ID,

CPROP_VALUE


FROM dbo.COMPANY_PROPERTY

where CPROP_PRP_ID = 370 and

convert(datetime, CPROP_VALUE, 103 ) = getdate()





"Erland Sommarskog" <esquel@sommarskog.se> wrote in message
news:Xns97E99E050F7DYazorman@127.0.0.1...
> Filips Benoit (benoit.filips@pandora.be) writes:
> > Float-convertions is OK
> >
> > Can't find a code for datetime-conversion from nvarchar format
DD/MM/YYYY
> > http://doc.ddart.net/mssql/sql70/ca-co_1.htm
>
> It's there on that page. You need to read the table headers a little more
> closely.
>
> > What is the max lenght of sql_variant?
>
> 8000 bytes.
>
> > Now CPRP_VALUE = nvarchar 1024 Is it possible to change the
> > field-datatype having existing data?
>
> One way or another it is. I would guess that ALTER TABLE ALTER COLUMN
works,
> but I have not actually tried it. But obviously if you do that, all
> data will be converted with a basetype of nvarchar, so you would have to
> write some script to repopulate the column.
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация