Can I configure an SQL Server 2008 DB so that it will save all empty strings as NULLs?

Posted by Ivan on Stack Overflow See other posts from Stack Overflow or by Ivan
Published on 2010-05-13T02:17:57Z Indexed on 2010/05/13 2:24 UTC
Read the original article Hit count: 343

Filed under:
|

In my current project it would be convenient to exclude empty strings from the domain, so that is an empty string is met wherever, it is treated as NULL, for example if I UPDATE [table] SET [Something]='', SQL Server should treat it as SET [Something]=NULL, so that in next SELECT a NULL is returned as [Something] value.

Should I use triggers or there is a better way?

© Stack Overflow or respective owner

Related posts about tsql

Related posts about null