Mar 31 2010

Find all SQL Stored Procedures with QUOTED_IDENTIFIER set to OFF

Category: Uncategorizedzvolkov @ 9:55 am

Whenever you create or recreate an SP, make sure QUOTED_IDENTIFIER is set to ON. The default value of OFF is there for backward compatibility only. Many modern features of SQL Server (such as filtered indexes) require Quoted Identifiers enabled. As you probably know whatever value of QUOTED_IDENTIFIER was set at the time of SP creation — this is what will be used during its execution. Two most common errors you’ll see if the value is set wrongly are:

UPDATE failed because the following SET options have incorrect settings: ‘QUOTED_IDENTIFIER’. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.

CREATE INDEX failed because the following SET options have incorrect settings: ‘QUOTED_IDENTIFIER’. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.

Here’s how to find all SPs with QUOTED_IDENTIFIER set to OFF:

SELECT
    SCHEMA_NAME(s.schema_id)  + '.' + s.name AS name,
    s.create_date,
    s.modify_date,
    OBJECTPROPERTY(s.object_id,'ExecIsQuotedIdentOn') AS IsQuotedIdentOn
FROM sys.objects s
WHERE
    s.type IN ('P','TR','V','IF','FN','TF')
    AND OBJECTPROPERTY(s.object_id,'ExecIsQuotedIdentOn') = 0
ORDER BY SCHEMA_NAME(s.schema_id)  + '.' + s.name DESC

In SQL 2000 you could mass-fix all SPs in bulk by setting bits 29 and 30 in sysobjects.status column but since SQL 2005 this column is no longer used to save the properties. It was a hack anyway.


Mar 09 2010

Moving off of TFS

Category: Uncategorizedzvolkov @ 12:49 pm

TFS issues:

  • Does not always get the latest version correctly
  • Merge gets confused : “Nothing to merge”
  • Files get out of sync, TFS said “Nothing to check in”
  • Workspaces get corrupted
  • Auto-merge is unreliable
  • The built-in merge tool is so bad it might as well not be included
  • Slow
  • The UI is annoying and esthetically displeasing
  • Limited search functionality
  • Integrated Work Item Tracking is terrible
  • Makes the controlled files read-only
  • UI is not optimized for pure-keyboard use.  We’re talking about programmers here!

 SVN issues:

  • No native integration with TFS Build Server
  • Auto-merge is still somewhat unreliable in more complex scenarios

 GIT / Mercurial issues:

  • No native integration with TFS Build Server
  • GUI tools are not very polished yet
  • Learning curve (aka paradigm shift)

With Mercurial and GIT there’s no “server” component. Instead, every developer gets a copy of every repository he works on. Still, it is often convenient to designate one location as the master copy.

Mercurial:

GIT:

SVN:

Microsoft CodePlex supports Mercurial as of Jan 2010. Google supports Mercurial on its Google Code. Google chose Mercurial after conducting extensive analysis of the differences between Mercurial and Git. Both Microsoft and Google mention Mercurial’s superior Windows compatibility.

There are hosted solutions like http://www.codebasehq.com/ or http://www.activestate.com/firefly/plans/ that support integrated work item tracking

Seriously though, Subversion is the way to go for most non-distributed development teams. Subversion is tried and true. Mercurial is nice for the federated open-source projects with lots of people developing in parallel but its overhead and the learning curve is just not worth the risk/overhead IMHO.

Still not sure about build server integration though…