SCC folder structure

I added a folder(CreateDB) and scripts inside the "Database" folder... using GIT outside SCC I committed the folder and scripts to master. Now I get a parse error every time I try to link or "get latest" (the script runs in TSQL fine) -

Comments

  • Hi @Elizabeth_Close_M1st,
    can you try to send the error details? If you get a view with an error string, you get also a hyperlink with the error description.
    Alessandro Alpi
    CTO @ Engage IT Services s.r.l.
    Database Administrator and Team Leader
    Microsoft MVP - Data Platform
    Staff member of getlatestversion.it community
    personal website | blog
  • Errors occurred whilst parsing file C:\Users\closee\AppData\Local\Red Gate\SQL Source Control 5\WorkingBases\sxap3hvq.cic\Databases\OnlineBanking\_Initialization\02_CreateNewOnlineBankingDatabase.sql

    '' at line 107, column 69

    '' at line 110, column 68

    *****

    This is line 107: ALTER DATABASE [OnlineBanking] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF, DIRECTORY_NAME = N'OnlineBankingDocStore' )
    This is line 110: ALTER DATABASE [OnlineBanking] SET TARGET_RECOVERY_TIME = 0 SECONDS

  • Hi,
    Could you please tell us how did you link the database with SQL Source control? Did you link it using the "Link database to Source Control" option? If so, and you're receiving errors, I think that it should work following these steps:
    1. create database using the script (not checkin in into the SQL Source Control folder)
    2. linking using the "Link to Source Control" (to git) using Sql Server Management Studio
    after these two options, everything should work.
    I'm a little bit confused about the Databases\OnlineBanking\_Initialization\ folder, which should not be part of the working base folder.
    In this link, there's how SQL Source Control works behind the scenes.

    Sorry if I didn't get it.
    Alessandro Alpi
    CTO @ Engage IT Services s.r.l.
    Database Administrator and Team Leader
    Microsoft MVP - Data Platform
    Staff member of getlatestversion.it community
    personal website | blog
  • The root of the problem here is that scripts folders are not SQL. Scripts folders are a diff-friendly representation of a database object model, which is intended to be human readable but not to be edited by hand.

    For a more obvious example of why this is the case, you could create any schema by manipulating a string and calling EXEC on that string, but SQL Compare couldn't be expected to understand what your script is doing in that case. SQL Compare therefore only understands a subset of valid SQL statements.
    Software Developer
    Redgate Software
Sign In or Register to comment.