INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

SQL Server 2008 r2 Data type defaults

SQL Server 2008 r2 Data type defaults

(OP)
Where, oh where do I go to change the default settings for data types? In particular I would like to change the default for decimal to be (18,2). Right now it seems to be (18,0) and while we think we have it taken care of in code, there always seems to be someplace we have missed and I would much rather have the default set at the db or even server level.

Thanks,
wb

RE: SQL Server 2008 r2 Data type defaults

SQLCop can check for this.

Click the SQLCop link in my signature. Download it. Run it. Expand Code, then click on Decimal Size Problem.

This should show you all the places in your code where you are using the decimal data type without specifying the precision and scale.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom

RE: SQL Server 2008 r2 Data type defaults

(OP)
I think perhaps I did not communicate what I was looking for very well. We have a tool for one of our users that she uses to create forms that in turn create tables in a db. Some of those tables have columns that need to be of type decimal(18,2), but the default when creating a decimal data type column seems to be (18,0). My question is, can I change that default to (18,2)? And if so, where/how?

And George, the code is in ASP and ASP.Net, will SQLCop look thru that code? I believe there are about 10k-12k lines of code.

Thanks!
wb

RE: SQL Server 2008 r2 Data type defaults

SQLCop looks through stored procedure code. Sorry.

You cannot change the default behavior of SQL Server to do what you want. Sorry again.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom

RE: SQL Server 2008 r2 Data type defaults

(OP)
Bummer, but good to know, thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close