Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 2008 r2 Data type defaults

Status
Not open for further replies.

wbodger

Programmer
Apr 23, 2007
769
US
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
 
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
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top