none
Cannot create a local database cache

    Question

  • I am currently trying to step through a basic ADO.Net Sync Services setup creating a Local Database Cache. I Select Add -> New Item in Visual Studio 2008, Select LocalDatabaseCache,  select AdventureWorks database from SQL Server 2008 SP1, select 3 tables to sync with, then press OK. The wizard generates some .SQL files and places them in my project, but then bombs out with a message saying "Incorrect Syntax Near '.'". I can't find any references to this issue on any forum, surely I can't be the only one experiencing this.

    the issue goes away if I de-select the "Use SQL Server Change Tracking" checkbox, so it must have something to do with the new capabilities in SQL Server 2008, but I'm not sure why.

    I am running Windows 7 64 bit, and I have tried both the x64 and x86 Sync Framework version, and both have the same problem. I currently have Sync Framework SDK 2.0 x86 installed.

    Any help would be greatly appreciated.

    Senior Developer - Readify
    Monday, January 25, 2010 2:54 AM

Answers

  • Hi there, well, I managed to find the bug....

    using SQL Server Profiler, the last statement it tries to execute before failing is 

    SELECT * FROM [Product]ion.[Product]

    So, if the schema name contains part of the table name, then the wizard crashes with the error described above.

    Senior Developer - Readify
    Tuesday, January 26, 2010 11:00 PM

All replies

  • Hello -

    1. Would you mind profiling the TSQL executed on the SQL server while seeing the error message Incorrect Syntax Near '.' and present it?
    2. Which 3 tables were used in synchronization?
    3. Can you get the call stack while the sync failed?

    Thanks.
    Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, January 25, 2010 9:52 PM
    Answerer
  • Hi there, well, I managed to find the bug....

    using SQL Server Profiler, the last statement it tries to execute before failing is 

    SELECT * FROM [Product]ion.[Product]

    So, if the schema name contains part of the table name, then the wizard crashes with the error described above.

    Senior Developer - Readify
    Tuesday, January 26, 2010 11:00 PM
  • In the process of trying to track down this bug, I also found another bug in the wizard.

    If you create a table like so in SQL Server

    CREATE TABLE SyncTable
    (
    ID int IDENTITY(1, 1),
    FirstName nvarchar(50),
    LastName nvarchar(50),
    CONSTRAINT pk_ID PRIMARY KEY CLUSTERED (ID ASC)  
    );


    INSERT INTO SyncTable
    (FirstName,  LastName)
    VALUES
    ('Scott', 'Baldwin');

    And then attempt to create a Local Database Cache, the wizard completes OK, but the generated code won't compile. I think it has something to do with the Table name "SyncTable".

    Senior Developer - Readify
    Tuesday, January 26, 2010 11:42 PM
  • Hi there, well, I managed to find the bug....

    using SQL Server Profiler, the last statement it tries to execute before failing is 

    SELECT * FROM [Product]ion.[Product]

    So, if the schema name contains part of the table name, then the wizard crashes with the error described above.

    Senior Developer - Readify
    This is the EXACT problem that I was having!  What the heck!?

    Thanks for the update!
    Saturday, March 06, 2010 2:11 PM
  • It seems such an obvious bug, I wonder if there is a plan to fix it?

    I guess the easy work around is to ensure that you name your tables in such a way that this never occurs, but that's problematic if you are given your database schema from an existing system.

    Senior Developer - Readify
    Sunday, March 07, 2010 12:31 AM