Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SP_Help  Prec = 10

Posted on 2009-12-18
10
Medium Priority
?
316 Views
Last Modified: 2012-05-08
I ran SP_Help and the Prec  column for my ID field equaled 10

What does this mean?
0
Comment
Question by:Mr_Shaw
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 26078973
what is the data type?
0
 

Author Comment

by:Mr_Shaw
ID: 26079056
int
0
 

Author Comment

by:Mr_Shaw
ID: 26079064
Here is my output

Column_name: ID
Type:      int
Computed:      no
Length:      4
Prec:      10
Scale:      0
Nullable:      no
TrimTrailingBlanks:      (n/a)
FixedLenNullInSource:      (n/a)
Collation:      Null
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 26

Expert Comment

by:tigin44
ID: 26079065
If sp_help is executed with no arguments, summary information of objects of all types that exist in the current database is returned.

so you have 10 objects in the db you are running this query.
0
 
LVL 26

Accepted Solution

by:
tigin44 earned 800 total points
ID: 26079095
in your case you are running sp_help with an argument probably a table name.
in this case the prec column indicates the precision of the columns of alphanumeric types.
0
 

Author Comment

by:Mr_Shaw
ID: 26079150
Sorry the exlpanation you gave were a little to techi more me.

I ran sp_help[Table_Name] to return some more information about my table.

ID is just one field from my table.
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 800 total points
ID: 26079165
your ID is int data type, there the precision and scale are "read only", aka for information.
means that in short, you can have up to 10 digits in the number
0
 
LVL 26

Expert Comment

by:tigin44
ID: 26079177
prec indicates the total number of digits..  In your case the data type is int and you can store a 10 digit number in that column...
if the column type to be float then the prec value would be 53 meaning that you can store 53 digit number including the point and the decimal place..
0
 
LVL 5

Assisted Solution

by:sureshchsahu
sureshchsahu earned 400 total points
ID: 26079189
In short for your problem
Precision is before decimal and scale is after deicmal

In below case Precision is 10 digits and scale is two digits
1234567890.24
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31667691
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question