improve.dk
Just another mindless drone looking for the perfect stack
posts - 220, comments - 475

SQL Server: Data Types


Getting bit by datetime rounding or why 23:59:59.999 > '23:59:59.999'

Written on Thursday, June 16, 2011 by Mark S. Rasmussen in SQL Server: Internals, SQL Server: Data Types

Why won't SQL Server store the datetime values you insert? Learn & understand why SQL Server will round any values of .998 or .999 to either .997 or .000 precision.

No comments | Write first comment
 

Saving space by storing decimal values in integer data types

Written on Tuesday, May 31, 2011 by Mark S. Rasmussen in SQL Server: Internals, SQL Server: Tricks, SQL Server: Data Types

Learn how to effectively store decimal values in SQL Server while taking up as little space as possible.

4 comments | Read comments
 

Bridging the gap between smallint and int

Written on Thursday, May 19, 2011 by Mark S. Rasmussen in SQL Server: Internals, SQL Server: Data Types

Learn the difference between smallint and int, as well as how to mimic the MySQL mediumint data type in SQL Server.

No comments | Write first comment
 

Wasted bytes add up, consider your data types carefully

Written on Tuesday, May 17, 2011 by Mark S. Rasmussen in SQL Server: Data Types, SQL Server: Optimization

You should consider your data types carefully when designing SQL Server tables. If not done properly you may waste lots of bytes per page.

2 comments | Read comments
 

Reading bits in OrcaMDF

Written on Thursday, May 12, 2011 by Mark S. Rasmussen in SQL Server: Internals, SQL Server: Data Types, SQL Server: OrcaMDF

Learn how bits are stored internally in SQL Server. In this post I'll also show how OrcaMDF parses bits from records.

No comments | Write first comment
 

Parsing dates in OrcaMDF

Written on Tuesday, May 10, 2011 by Mark S. Rasmussen in SQL Server: Internals, SQL Server: Data Types, SQL Server: OrcaMDF

Learn how SQL Server data types like date, datetime and smalldatetime are stored internally. In this post I'll also show how OrcaMDF parses these types.

No comments | Write first comment
 

Tricky SQL Server decimal math

Written on Wednesday, May 06, 2009 by Mark S. Rasmussen in SQL Server: Data Types, SQL Server: Optimization

When performing math using SQL Server decimals, the precision may change and cause implicit conversions. Learn how to predict and avoid this situation.

No comments | Write first comment