THE SQL Server Blog Spot on the Web
Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Peter DeBetta's SQL Programming Blog

Peter DeBetta's blog about programming in SQL Server 2008, 2005, etc. using technologies such as T-SQL, .NET, CLR, C#, VB, Visual Studio, and SQL Server Management Studio.

SQL Bracketed Identifiers and Community Server

Bloggers at SQLblog.com were occasionally having issues posting. We had narrowed down the cause to the use of bracketed identifiers with certain text, such as [name] or [date], so that when a post contained a query such as this:

SELECT Description as [name],
    , OrderDate as [date]
FROM SomeTable

Attempting to publish it to the blog would simply cause an unhandled exception. The problem has to do with the Community Server TextPart component, which uses bracketed identifiers to replace snippets and for certain post settings when posting. I found a work around, however, which involves making a change to the ScottWater.CS.Modules source code and redeploying. Here is the code change, found in ScottWater.CS.Modules.MetaBlogExtender class, csa_PreProcessPost method:

...
foreach
(TextPart tp in e.TextParts)
{
    string name = tp.Name.ToLower();
    /* Start of added code */
    try
    {
        String testValue = tp.Value;
    }
    catch (ArgumentOutOfRangeException)
    {
        break;
    }
    /* End of added code */
    switch
(name)
        {
...

 


Published Thursday, February 07, 2008 1:20 PM by Peter DeBetta

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit

About Peter DeBetta

Peter DeBetta is an independent consultant specializing in design, development, implementation, and deployment of Microsoft SQL Server, Microsoft SharePoint Server, and .NET solutions. Peter writes courseware, articles, and books – most notably the title Introducing SQL Server 2005 for Developers from Microsoft Press. Peter speaks at conferences around the world, including TechEd, SQL PASS Community Summit, DevTeach, SQL Connections, DevWeek, and VSLive!

Peter is a Microsoft MVP for SQL Server, an MCP, President of the North Texas SQL Server User Group, and a member of PASS.

When Peter isn’t working, you can find him singing and playing guitar (click here to hear an original song by Peter), taking pictures, or simply enjoying life with his wife, son, and new daughter.
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement