Share via

Visual Studio TFS SQL Repository

Ponkam, Sumanth (Cognizant) 70 Reputation points
2024-10-24T05:49:49.23+00:00

Hi Team,

we are in need of using the Create or Alter statement for stored Procedures in TFS. while building the project we are getting below error:

we are using VS2022 for our TFS project.

Create Or Alter Procedure MyProc

Build Error:

SQL70001: This statement is not recognized in this context.

Can some one help me how can we place the Create or Alter statements for SQL objects in VS TFS.

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

Answer accepted by question author
  1. Olaf Helper 47,616 Reputation points
    2024-10-24T06:12:37.0933333+00:00

    we are in need of using the Create or Alter statement for stored Procedures in TFS

    TFS is just the source control system, it has not really a knowledge about your code.

    So you are using Visual Studio with a "Database project"?

    As the message say: In a DB project only "CREATE" statements are allowed, but not "CREATE OR ALTER".

    The build process decides whether to CREATE or ALTER an object.

    Remove the "...OR ALTER" from your code.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.