Question: I have a navigation app with 5 pages. I also have a usercontrol with 3 radio buttons. This usercontrol is used by all 5 pages in my app. By default the first radio button is selected. However if the user clicks the 3rd radio button and I go to another page I want my usercontrol to still show that 3rd radio button as selected. How do I go about accomplishing this task?

Answer: 
Using INFORMATION\_SCHEMA for views and code will *fail*. The data is limited to nvarchar(4000), so longer stuff will not be read. Use [sys.sql\_modules](http://msdn.microsoft.com/en-us/library/ms175081.aspx) or [OBJECT\_DEFINITION](http://msdn.microsoft.com/en-us/library/ms176090.aspx).

For tables, it's more difficult. A "table" consists of columns, constraints, indexes, possibly rules, UDTs (did I forget anything?). This is why SSMS has so many table scripting options compared to a view or stored proc.

I'd suggest profiling SSMS and hope it doesn't use SMO... or use SMO via CLR code or even xp\_cmdshell.
You can use SMO (Microsoft.SqlServer.Smo) from .NET to script the table.