30.06.2013 Views

SQL Server Team-based Development - Red Gate Software

SQL Server Team-based Development - Red Gate Software

SQL Server Team-based Development - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

45<br />

Chapter 2: Documenting your Database<br />

hard to read. You are liable to miss important information. More modern approaches<br />

to structured text, such as YAML, provide a far easier and more intuitive approach, and<br />

allow for a much more versatile way of handling paragraphs of text.<br />

YAML and JSON<br />

It is far better to take a human-oriented approach to headers. Here is a YAML version of<br />

the header which is directly equivalent to the XMLDOCS version in Listing 2-2.<br />

IF OBJECT_ID(N'IsSpace') IS NOT NULL<br />

DROP FUNCTION IsSpace<br />

GO<br />

CREATE FUNCTION dbo.[IsSpace] ( @string VARCHAR(MAX) )<br />

/**<br />

summary: ><br />

IsSpace string Function Returns Non-Zero if all characters<br />

in s are whitespace characters, 0 otherwise.<br />

example:<br />

– code: Select dbo.IsSpace('how many times must i tell you')<br />

– code: Select dbo.IsSpace(' []{}"!@#$%9 )))))))')<br />

– code: Select dbo.IsSpace(' ????/>.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!