How can we help you today? How can we help you today?

How to link existing Stored Proc to an existing source file in SQL Source Control and TFS?

I've an existing stored procedure and I made a minor modification on it using SSMS. I've hit an issue when checking-in due to policies. So instead of checking-in from SQL Source Control, I checked-out from the file from TFS using Visual Studio and directly modify the file and checked-in. The check-in was successful. But when I modify the stored procedure from SSMS and checkin again using SQL Source Control (with #ignorepolicies in the comment section this time), the change type is New and it created a new file. This is just example to illustrate the file being created (ExampleStoredProcName1.sql). There was a new file created with "1" suffix on it.
Oinodelec31
0

Comments

5 comments

  • Pete_Ruiz
    Hello,

    Thanks for reaching out and sorry that you're having trouble with SQL Source Control. To confirm, you modified the object outside of SQL Source Control and then modified the same object in SQL Source Control? When you checked in the modification in Visual Studio, did you get the latest change in SQL Source Control. Did the tool see the difference? Also, what change did you make to the file?

    We don't recommend manually modifying the .sql scripts outside of SQL Source Control for this reason.

    Kind regards,

    Pete Ruiz
    Pete_Ruiz
    0
  • Oinodelec31
    The tool did not see the difference. What I did was to delete the file from TFS and check-in again my changes from the SQL Source Control.
    Oinodelec31
    0
  • Pete_Ruiz
    @Oinodelec31 Can you try unlinking the database from source control then clearing the content in the caches folder located in %localappdata%\Red Gate\SQL Source Control <version>\Caches, then relink the database to source control and confirm if anything changes?

    Kind regards,

    Pete Ruiz
    Pete_Ruiz
    0
  • Oinodelec31
    I have fixed the issue by deleting the file and checking it again.
    Oinodelec31
    0
  • Pete_Ruiz
    Hello @Oinodelec31 I'm glad you were able to resolve the issue! Please do feel free to reach back out if anything else comes up.

    Kind regards,

    Pete Ruiz
    Pete_Ruiz
    0

Add comment

Please sign in to leave a comment.