locked
Invalid Column Name with Microsoft Sync Framework RRS feed

  • Question

  • Hello Everybody,

    I am developing a WPF application that requires sync between SQL Server 2008 on server Side, and SQL Server Express on Local.

    I configured the sync and it works fine on server side. However, when i try to create the sync tables on the local database it gives an "Invalid Column Name 'ID'" error.

    The same database is mapped on both sides.

    I couldn't find a way to fix this. Please Help Me.

    StackTrace :    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncProcedureHelper.CreateBulkInsert(SqlTransaction trans, DbSyncCreationOption option)
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncTablePA first chance exception of type 'System.NullReferenceException' occurred in BUS.dll
    System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>GestionNC.vshost.exe</AppDomain><Exception><ExceptionType>System.Reflection.TargetInvocationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Exception has been thrown by the target of an invocation.</Message><StackTrace>   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp;amp; canBeCached, RuntimeMethodHandleInternal&amp;amp; ctor, Boolean&amp;amp; bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Xaml.Schema.XamlTypeInvoker.CreateInstance(Object[] arguments)
       at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstanceWithCtor(XamlType xamlType, Object[] args)
       at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance(XamlType xamlType, Object[] args)
       at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.CreateInstance(XamlType xamlType, Object[] args)
       at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(ObjectWriterContext ctx)
       at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
       at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
       at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
       at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
       at System.Windows.Application.DoStartup()
       at System.Windows.Application.&amp;lt;.ctor&amp;gt;b__1(Object unused)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp;amp; handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp;amp; handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG&amp;amp; msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at GestionNC.App.Main() in D:\Autre\Etudes\TP\C#\GestionNC\GestionNC\obj\x86\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.NullReferenceException: Object reference not set to an instance of an object.
       at BUS.Synchronisation.SyncClient() in D:\Autre\Etudes\TP\C#\GestionNC\BUS\Synchronisation.cs:line 75
       at GestionNC.Authentification..ctor() in D:\Autre\Etudes\TP\C#\GestionNC\GestionNC\Authentification.xaml.cs:line 18
       --- End of inner exception stack trace ---
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp;amp; canBeCached, RuntimeMethodHandleInternal&amp;amp; ctor, Boolean&amp;amp; bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Xaml.Schema.XamlTypeInvoker.CreateInstance(Object[] arguments)
       at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstanceWithCtor(XamlType xamlType, Object[] args)
       at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance(XamlType xamlType, Object[] args)
       at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.CreateInstance(XamlType xamlType, Object[] args)
       at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(ObjectWriterContext ctx)
       at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
       at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
       at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
       at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
       at System.Windows.Application.DoStartup()
       at System.Windows.Application.&amp;lt;.ctor&amp;gt;b__1(Object unused)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp;amp; handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp;amp; handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG&amp;amp; msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at GestionNC.App.Main() in D:\Autre\Etudes\TP\C#\GestionNC\GestionNC\obj\x86\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()</ExceptionString><DataItems><Data></Data></DataItems><InnerException><ExceptionType>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Object reference not set to an instance of an object.</Message><StackTrace>   at BUS.Synchronisation.SyncClient() in D:\Autre\Etudes\TP\C#\GestionNC\BUS\Synchronisation.cs:line 75
       at GestionNC.Authentification..ctor() in D:\Autre\Etudes\TP\C#\GestionNC\GestionNC\Authentification.xaml.cs:line 18</StackTrace><ExceptionString>System.NullReferenceException: Object reference not set to an instance of an object.
       at BUS.Synchronisation.SyncClient() in D:\Autre\Etudes\TP\C#\GestionNC\BUS\Synchronisation.cs:line 75
       at GestionNC.Authentification..ctor() in D:\Autre\Etudes\TP\C#\GestionNC\GestionNC\Authentification.xaml.cs:line 18</ExceptionString></InnerException></Exception></TraceRecord>
    rovisioning.Apply(SqlTransaction trans)
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.ApplyScope(SqlConnection connection)
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.ApplyInternal(SqlConnection connection)
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.Apply()
       at BUS.Synchronisation.SyncClient() in D:\Autre\Etudes\TP\C#\GestionNC\BUS\Synchronisation.cs:line 69
    Sunday, September 16, 2012 5:18 PM

Answers

  • you should still be able to capture the failing SQL from the client.

    anyways, try running the script you captured above against the client database and see where it fails.

    • Marked as answer by Nohad Imad Wednesday, September 26, 2012 2:21 PM
    Tuesday, September 25, 2012 12:53 PM
  • I Managed To Provision the Client Database after executing the script above, Deprovisioning the database and then provisioning it normally.

    Thanks JuneT for the Help.

    Now i have another problem.

    I'm actually working with NHibernate and since the client database is provisioned none of my UPDATE and DELETE Queries work anymore when i deprovision they work normally again.

    Any Thoughts of what could cause this issue ??

    • Marked as answer by Nohad Imad Wednesday, September 26, 2012 2:21 PM
    Wednesday, September 26, 2012 2:20 PM

All replies

  • does the client database contain the tables already? can you confirm it has that column? has this been configured for sync before?

    Monday, September 17, 2012 2:40 AM
  • The Client database contains only the data tables, it doesn't have sync related tables.

    The database on the server is the same as on the client because i mapped them from the same classes Using NHibernate.

    I am getting the error while configuring the sync on client side. so it's only configured for the server.

    Monday, September 17, 2012 4:31 AM
  • i suggest you review the tables or even profile the sql being sent. that error is coming from SQL Server itself not being able to create a stored procedure.

    you can actually script the provisioning so you can pin point where it's failing.

    Monday, September 17, 2012 5:45 AM
  • Seems Like A Good IDea but how can i display the sql being created while provisioning the client ??
    Monday, September 17, 2012 7:59 PM
  • you can run SQL Profiler and see the SQL commands on the fly.

    or

    use the Script() method on the provisioning API

    Tuesday, September 18, 2012 1:29 AM
  • I Managed to get the sql code created on server side while provisioning, i couldn't retrieve the one from client side because the provisioning never takes place there which causes the Invalid column error this is what the script looks like :

    -- BEGIN Enable Snapshot Isolation on Database 'GestionNC' if needed

    IF EXISTS (SELECT NAME FROM sys.databases where NAME = N'GestionNC' AND [snapshot_isolation_state] = 0)

    BEGIN

    ALTER DATABASE [GestionNC] SET ALLOW_SNAPSHOT_ISOLATION ON
    END
    GO
    -- 
    END 
    Enable Snapshot Isolation on Database 'GestionNC' 
    if needed

    -- 
    BEGIN Create Scope Info Table named [scope_info]
    IF NOT EXISTS (SELECT t.name FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id WHERE t.name = N'scope_info' AND s.name = N'dbo')

    BEGIN
    CREATE TABLE [scope_info] ([scope_local_id] int IDENTITY(1,1) NOT NULL, [scope_id] uniqueidentifier DEFAULT NEWID() NOT NULL, [sync_scope_name] nvarchar(100) NOT NULL, [scope_sync_knowledge] varbinary(max) NULL, [scope_tombstone_cleanup_knowledge] varbinary(max) NULL, [scope_timestamp] timestamp NULL, [scope_config_id] uniqueidentifier NULL, [scope_restore_count] int DEFAULT 0 NOT NULL, [scope_user_comment] nvarchar(max) NULL)

    ALTER TABLE [scope_info] ADD CONSTRAINT [PK_scope_info] PRIMARY KEY ([sync_scope_name])
    END
    GO
    -- END Create Scope Info Table named [scope_info]

    -- BEGIN Create Scope Config Table named [scope_config]
    IF NOT EXISTS (SELECT t.name FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id WHERE t.name = N'scope_config' AND s.name = N'dbo')

    BEGIN
    CREATE TABLE [scope_config] ([config_id] uniqueidentifier NOT NULL, [config_data] xml NOT NULL, [scope_status] char NULL)

    ALTER TABLE [scope_config] ADD CONSTRAINT [PK_scope_config] PRIMARY KEY ([config_id])
    END
    GO
    -- END Create Scope Config Table named [scope_config]

    -- 
    BEGIN Create Schema Info Table named [schema_info]

    IF NOT EXISTS (SELECT t.name FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id WHERE t.name = N'schema_info' AND s.name = N'dbo')

    BEGIN
    CREATE TABLE [schema_info] ([schema_major_version] integer NOT NULL, [schema_minor_version] integer NOT NULL, [schema_extended_info] nvarchar(100) NOT NULL)

    ALTER TABLE [schema_info] ADD CONSTRAINT [PK_schema_info] PRIMARY KEY ([schema_major_version], [schema_minor_version])
    END
    GO
    -- 
    END 
    Create Schema Info Table named [schema_info]


    -- BEGIN Add version info for schema

    IF NOT EXISTS (SELECT [schema_major_version] FROM [schema_info]) 
    INSERT INTO [schema_info] ([schema_major_version], [schema_minor_version], [schema_extended_info]) VALUES (2, 1, N'')

    GO

    -- END Add version info for schema


    -- BEGIN Add scope configuration entry for Config ID '4480c180-f640-4b29-a063-b48a121b9852'
    INSERT INTO [scope_config] ([config_id], [config_data], [scope_status]) VALUES ('4480c180-f640-4b29-a063-b48a121b9852', N'<SqlSyncProviderScopeConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" IsTemplate="false"><Adapter Name="[NonConformite]" GlobalName="[NonConformite]" TrackingTable="[NonConformite_tracking]" SelChngProc="[NonConformite_selectchanges]" SelRowProc="[NonConformite_selectrow]" InsProc="[NonConformite_insert]" UpdProc="[NonConformite_update]" DelProc="[NonConformite_delete]" InsMetaProc="[NonConformite_insertmetadata]" UpdMetaProc="[NonConformite_updatemetadata]" DelMetaProc="[NonConformite_deletemetadata]" BulkTableType="[NonConformite_BulkType]" BulkInsProc="[NonConformite_bulkinsert]" BulkUpdProc="[NonConformite_bulkupdate]" BulkDelProc="[NonConformite_bulkdelete]" InsTrig="[NonConformite_insert_trigger]" UpdTrig="[NonConformite_update_trigger]" DelTrig="[NonConformite_delete_trigger]"><Col name="IdNC" type="int" idSeed="0" idStep="1" param="@P_1" pk="true" /><Col name="Ref_FNC" type="nvarchar" size="255" null="true" param="@P_2" /><Col name="Code" type="nvarchar" size="255" null="true" param="@P_3" /><Col name="Cause_NC" type="nvarchar" size="255" null="true" param="@P_4" /><Col name="Autorite_derogation" type="nvarchar" size="255" null="true" param="@P_5" /><Col name="Categorie" type="nvarchar" size="255" null="true" param="@P_6" /><Col name="SousCategorie" type="nvarchar" size="255" null="true" param="@P_7" /><Col name="Commentaire_traitement" type="nvarchar" size="255" null="true" param="@P_8" /><Col name="consistance_controle" type="nvarchar" size="255" null="true" param="@P_9" /><Col name="Consistance_correction" type="nvarchar" size="255" null="true" param="@P_10" /><Col name="controle_satisfaisant" type="bit" null="true" param="@P_11" /><Col name="Date_effective" type="nvarchar" size="255" null="true" param="@P_12" /><Col name="Date_emission" type="nvarchar" size="255" param="@P_13" /><Col name="Date_fermeture" type="nvarchar" size="255" null="true" param="@P_14" /><Col name="Date_prevue" type="nvarchar" size="255" null="true" param="@P_15" /><Col name="Date_realisation" type="nvarchar" size="255" null="true" param="@P_16" /><Col name="Date_validation" type="nvarchar" size="255" null="true" param="@P_17" /><Col name="Description" type="nvarchar" size="255" null="true" param="@P_18" /><Col name="Num" type="int" null="true" param="@P_19" /><Col name="Pieces_jointes" type="bit" null="true" param="@P_20" /><Col name="Proposition_action_corrective" type="bit" null="true" param="@P_21" /><Col name="Reference_FACP" type="nvarchar" size="255" null="true" param="@P_22" /><Col name="Responsable" type="nvarchar" size="255" null="true" param="@P_23" /><Col name="resultat_detaille_controle" type="nvarchar" size="255" null="true" param="@P_24" /><Col name="Traitement_retenu_NC" type="nvarchar" size="255" null="true" param="@P_25" /><Col name="Type_NC" type="nvarchar" size="255" null="true" param="@P_26" /><Col name="Visa_DT" type="bit" null="true" param="@P_27" /><Col name="Visa_RQSE" type="bit" null="true" param="@P_28" /><Col name="Version" type="nvarchar" size="255" null="true" param="@P_29" /></Adapter><Adapter Name="[Notification]" GlobalName="[Notification]" TrackingTable="[Notification_tracking]" SelChngProc="[Notification_selectchanges]" SelRowProc="[Notification_selectrow]" InsProc="[Notification_insert]" UpdProc="[Notification_update]" DelProc="[Notification_delete]" InsMetaProc="[Notification_insertmetadata]" UpdMetaProc="[Notification_updatemetadata]" DelMetaProc="[Notification_deletemetadata]" BulkTableType="[Notification_BulkType]" BulkInsProc="[Notification_bulkinsert]" BulkUpdProc="[Notification_bulkupdate]" BulkDelProc="[Notification_bulkdelete]" InsTrig="[Notification_insert_trigger]" UpdTrig="[Notification_update_trigger]" DelTrig="[Notification_delete_trigger]"><Col name="idNotif" type="int" idSeed="0" idStep="1" param="@P_1" pk="true" /><Col name="Description_Notif" type="nvarchar" size="255" null="true" param="@P_2" /><Col name="DateNotif" type="varbinary" size="max" null="true" param="@P_3" /><Col name="Lue" type="bit" null="true" param="@P_4" /><Col name="Type" type="nvarchar" size="255" null="true" param="@P_5" /><Col name="NC_Id" type="int" param="@P_6" /><Col name="User_Id" type="int" param="@P_7" /></Adapter><Adapter Name="[Utilisateur]" GlobalName="[Utilisateur]" TrackingTable="[Utilisateur_tracking]" SelChngProc="[Utilisateur_selectchanges]" SelRowProc="[Utilisateur_selectrow]" InsProc="[Utilisateur_insert]" UpdProc="[Utilisateur_update]" DelProc="[Utilisateur_delete]" InsMetaProc="[Utilisateur_insertmetadata]" UpdMetaProc="[Utilisateur_updatemetadata]" DelMetaProc="[Utilisateur_deletemetadata]" BulkTableType="[Utilisateur_BulkType]" BulkInsProc="[Utilisateur_bulkinsert]" BulkUpdProc="[Utilisateur_bulkupdate]" BulkDelProc="[Utilisateur_bulkdelete]" InsTrig="[Utilisateur_insert_trigger]" UpdTrig="[Utilisateur_update_trigger]" DelTrig="[Utilisateur_delete_trigger]"><Col name="IdUtil" type="int" idSeed="0" idStep="1" param="@P_1" pk="true" /><Col name="Login" type="nvarchar" size="255" null="true" param="@P_2" /><Col name="Passwd" type="nvarchar" size="255" null="true" param="@P_3" /><Col name="Nom" type="nvarchar" size="255" null="true" param="@P_4" /><Col name="Prenom" type="nvarchar" size="255" null="true" param="@P_5" /><Col name="Role" type="nvarchar" size="255" null="true" param="@P_6" /></Adapter><Adapter Name="[Portee_NC]" GlobalName="[Portee_NC]" TrackingTable="[Portee_NC_tracking]" SelChngProc="[Portee_NC_selectchanges]" SelRowProc="[Portee_NC_selectrow]" InsProc="[Portee_NC_insert]" UpdProc="[Portee_NC_update]" DelProc="[Portee_NC_delete]" InsMetaProc="[Portee_NC_insertmetadata]" UpdMetaProc="[Portee_NC_updatemetadata]" DelMetaProc="[Portee_NC_deletemetadata]" BulkTableType="[Portee_NC_BulkType]" BulkInsProc="[Portee_NC_bulkinsert]" BulkUpdProc="[Portee_NC_bulkupdate]" BulkDelProc="[Portee_NC_bulkdelete]" InsTrig="[Portee_NC_insert_trigger]" UpdTrig="[Portee_NC_update_trigger]" DelTrig="[Portee_NC_delete_trigger]"><Col name="NonConformite_id" type="int" param="@P_1" pk="true" /><Col name="Portee_NC" type="varchar" size="255" param="@P_2" pk="true" /></Adapter><Adapter Name="[Source_NC]" GlobalName="[Source_NC]" TrackingTable="[Source_NC_tracking]" SelChngProc="[Source_NC_selectchanges]" SelRowProc="[Source_NC_selectrow]" InsProc="[Source_NC_insert]" UpdProc="[Source_NC_update]" DelProc="[Source_NC_delete]" InsMetaProc="[Source_NC_insertmetadata]" UpdMetaProc="[Source_NC_updatemetadata]" DelMetaProc="[Source_NC_deletemetadata]" BulkTableType="[Source_NC_BulkType]" BulkInsProc="[Source_NC_bulkinsert]" BulkUpdProc="[Source_NC_bulkupdate]" BulkDelProc="[Source_NC_bulkdelete]" InsTrig="[Source_NC_insert_trigger]" UpdTrig="[Source_NC_update_trigger]" DelTrig="[Source_NC_delete_trigger]"><Col name="NonConformite_id" type="int" param="@P_1" pk="true" /><Col name="Source_NC" type="varchar" size="255" param="@P_2" pk="true" /></Adapter></SqlSyncProviderScopeConfiguration>', 'P')
    GO

    -- END Add scope configuration entry for Config ID '4480c180-f640-4b29-a063-b48a121b9852'


    -- BEGIN Add Scope Info entry for Scope 'GNCScope'

    INSERT INTO [scope_info] ([sync_scope_name], [scope_config_id], [scope_user_comment]) VALUES (N'GNCScope', '4480c180-f640-4b29-a063-b48a121b9852', N'')
    GO

    -- END Add Scope Info entry for Scope 'GNCScope'


    UPDATE [scope_config] SET scope_status = 'C' WHERE [config_id] = '4480c180-f640-4b29-a063-b48a121b9852';

    Tuesday, September 25, 2012 11:53 AM
  • you should still be able to capture the failing SQL from the client.

    anyways, try running the script you captured above against the client database and see where it fails.

    • Marked as answer by Nohad Imad Wednesday, September 26, 2012 2:21 PM
    Tuesday, September 25, 2012 12:53 PM
  • I Managed To Provision the Client Database after executing the script above, Deprovisioning the database and then provisioning it normally.

    Thanks JuneT for the Help.

    Now i have another problem.

    I'm actually working with NHibernate and since the client database is provisioned none of my UPDATE and DELETE Queries work anymore when i deprovision they work normally again.

    Any Thoughts of what could cause this issue ??

    • Marked as answer by Nohad Imad Wednesday, September 26, 2012 2:21 PM
    Wednesday, September 26, 2012 2:20 PM