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
 Does int DataType holds the value of String
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Abid
Posting Yak Master

Pakistan
105 Posts

Posted - 04/13/2013 :  00:59:15  Show Profile  Reply with Quote
Hi. I have a Table in SQL Server 2005 Standard, in which StID is a Primary Key, set to int DataType. When I insert the data from Front End, from VB.Net form, so i insert the String Value. right.

My question is that why it doesn't give any error, for sending string to DataType Int?

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 04/13/2013 :  01:44:01  Show Profile  Reply with Quote
may be because the string value contain only numeric data. It will work fine so far as the data can be converted to integer type.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Abid
Posting Yak Master

Pakistan
105 Posts

Posted - 04/13/2013 :  06:58:07  Show Profile  Reply with Quote
But I did not use any conversion in my code. Does SQL automatically do this conversion
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3578 Posts

Posted - 04/13/2013 :  07:41:22  Show Profile  Reply with Quote
quote:
Originally posted by Abid

But I did not use any conversion in my code. Does SQL automatically do this conversion

Yes, it does. Se here http://msdn.microsoft.com/en-us/library/ms141260(v=sql.105).aspx
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