3

I have added a new stored procedure and added it to my sqlproj file. But when I generate script to publish my database, the changes are not getting reflected in the generated script.

Srinivas
  • 45
  • 1
  • 5

2 Answers2

10

Have a look at the 'Build Action' property of the sql script in the solution explorer..check that its not set to 'None' - from memory it needs to be set to 'Build'

sburgess123
  • 332
  • 2
  • 10
1

For a stored procedure, following lines must not be there

IF EXISTS (...

    DROP PROCEDURE ..

Once these lines are removed, set the build action to "Build" and Copy To Output = None

The procedure will then be included in the build script

NitinSingh
  • 2,029
  • 1
  • 15
  • 33