SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Why Conversion error when selecting from View?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

beatkeeper25
Starting Member

19 Posts

Posted - 09/11/2013 :  16:11:54  Show Profile  Reply with Quote
I have a view that is involved in an import. Sometimes the import will fail with the following error:

Msg 242, Level 16, State 3, Line 2
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

I can recreate the error just from selecting from the view. Why would something be converting when just selecting from view?

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 09/11/2013 :  16:17:40  Show Profile  Reply with Quote
The error should tell you what you need to know. it appears the view is converting from a string to a date and the string is out of range.
Go to Top of Page

beatkeeper25
Starting Member

19 Posts

Posted - 09/11/2013 :  17:15:38  Show Profile  Reply with Quote
With a view a lot of columms, how do I figure out which column it is?
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37274 Posts

Posted - 09/11/2013 :  17:17:38  Show Profile  Visit tkizer's Homepage  Reply with Quote
quote:
Originally posted by beatkeeper25

Why would something be converting when just selecting from view?



Show us the definition of the view. You may also need to show us data types of the tables involved.

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

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 09/12/2013 :  15:54:54  Show Profile  Reply with Quote
quote:
Originally posted by beatkeeper25

I have a view that is involved in an import. Sometimes the import will fail with the following error:

Msg 242, Level 16, State 3, Line 2
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

I can recreate the error just from selecting from the view. Why would something be converting when just selecting from view?


may be this?
http://visakhm.blogspot.in/2011/12/why-iso-format-is-recommended-while.html


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000