Skip to content

Commit

Permalink
Corrected SqlServerProcessor IndexExists syntax fixes #315
Browse files Browse the repository at this point in the history
  • Loading branch information
tommarien committed Nov 15, 2012
1 parent 98f3810 commit 56190b3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public override bool ConstraintExists(string schemaName, string tableName, strin

public override bool IndexExists(string schemaName, string tableName, string indexName)
{
return Exists("SELECT NULL FROM sysindexes WHERE name = '{0}'", FormatSqlEscape(indexName));
return Exists("SELECT * FROM sys.indexes WHERE name = '{0}' and object_id=OBJECT_ID('{1}.{2}')", FormatSqlEscape(indexName), SafeSchemaName(schemaName), FormatSqlEscape(tableName));
}

public override void Execute(string template, params object[] args)
Expand Down

0 comments on commit 56190b3

Please sign in to comment.