From 58ec9aa1fbdc5366829c21894770fd1fa98a4466 Mon Sep 17 00:00:00 2001 From: Marchy Date: Thu, 12 Sep 2013 22:58:23 -0400 Subject: [PATCH] Added support for tables that have computed columns or indexed views --- src/AppHarbor.SqlServerBulkCopy/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AppHarbor.SqlServerBulkCopy/Program.cs b/src/AppHarbor.SqlServerBulkCopy/Program.cs index 426b25b..4f00192 100644 --- a/src/AppHarbor.SqlServerBulkCopy/Program.cs +++ b/src/AppHarbor.SqlServerBulkCopy/Program.cs @@ -146,7 +146,8 @@ static void Main(string[] args) EXEC sp_msforeachtable ""ALTER TABLE ? NOCHECK CONSTRAINT all"" -- delete data in all tables - EXEC sp_msforeachtable ""DELETE FROM ?"" + -- NOTE: The quoted identifier option is enabled to fix a bug where the query fails if DB has any computed columns or indexed views + EXEC sp_msforeachtable ""SET QUOTED_IDENTIFIER ON; DELETE FROM ?"" -- enable all constraints exec sp_msforeachtable ""ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all""