getdate() from SQL 2008 to smalldate colum on a table in SQL2005

  • Hello,

    Anyone know if this is a bug that we can't insert getdate() value from SQL 2008 R2 to a smalldate column on a table in SQL 2005 via Linked server connection? It works from SQL 2012 but not from SQL 2008R2.

    Thanks much for your help!

  • Biank (7/27/2015)


    Hello,

    Anyone know if this is a bug that we can't insert getdate() value from SQL 2008 R2 to a smalldate column on a table in SQL 2005 via Linked server connection? It works from SQL 2012 but not from SQL 2008R2.

    Thanks much for your help!

    Cannot remember such an issue but (un)fortunately I don't have any 2K5 servers anymore, can you post the code you are using?

    😎

  • sure, it is basically simple statement:

    -- from ServerA

    create table Testdb.dbo.t1 (c1 datetime, c2 smalldatetime)

    -- from ServerB

    insert into ServerA.TestDB.dbo.t1 select getdate(), getdate()

    I'm getting this from SQL 2008 R2 only.

    The OLE DB provider "SQLNCLI10" for linked server "ServerA" could not INSERT INTO table "[ServerA].[TestDB].[dbo].[t1]" because of column "c2".

    Conversion failed because the data value overflowed the data type used by the provider.

    However, the same insert statement works from SQL 2012 and within the same server whether it is 2008 or 2005. I just failed only between SQL 2008 R2 and SQL 2005.

    Thanks again.

  • Perhaps this?

    https://support.microsoft.com/en-us/kb/2699687

    Cheers!

  • Ah, this could be it.

    Thanks much all!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply