Permalink
Browse files

Corrected SqlServerProcessor IndexExists syntax fixes #315

  • Loading branch information...
1 parent 98f3810 commit 56190b3d14c1277ebd78633de05834a55c26228f @tommarien tommarien committed Nov 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/FluentMigrator.Runner/Processors/SqlServer/SqlServerProcessor.cs
@@ -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)

0 comments on commit 56190b3

Please sign in to comment.