title: Getting numeric precision in case of int datatype of SQL Server
body: <p>I am fetching following details of columns from SQL Server:</p>
  <pre><code>Size
  Precision
  Scale
  </code></pre>
  <p>But I have noticed that in case of int I am getting 10 as precision but when i did some research, I couldn't find any such thing related to int, and that int datatype have precision of 10 or in SQL Server Management Studio.</p>
  <p>So I don't know how 10 is coming as precision in case of int data type.</p>
  <p><strong>Table</strong>:</p>
  <p><a href="https://i.stack.imgur.com/2ki93.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2ki93.png" alt="enter image description here" /></a></p>
  <p><strong>Screenshot</strong>:</p>
  <p><a href="https://i.stack.imgur.com/caTun.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/caTun.png" alt="Output" /></a></p>
  <p><strong>Code:</strong></p>
  <pre><code>String[] columnRestrictions = new String[4];
  columnRestrictions[0] = 'MyDb';
  columnRestrictions[1] = 'dbo';
  columnRestrictions[2] = 'Employee';
  
  using (SqlConnection con = new SqlConnection(&quot;MyConnectionString&quot;))
  {
      con.Open();
      var columns = con.GetSchema(&quot;Columns&quot;, columnRestrictions).AsEnumerable()
           .Select
            (
                   t =&gt; new 
                   {
                       Name = t[3].ToString(),
                       Datatype = t.Field&lt;string&gt;(&quot;DATA_TYPE&quot;),
                       IsNullable = t.Field&lt;string&gt;(&quot;is_nullable&quot;),
                       Size = t.Field&lt;Int32?&gt;(&quot;character_maximum_length&quot;),
                       NumericPrecision = t.Field&lt;int?&gt;(&quot;NUMERIC_PRECISION&quot;),
                       NumericScale = t.Field&lt;Int32?&gt;(&quot;NUMERIC_SCALE&quot;)
                   }).ToList();
  </code></pre>