TSD3017: The ALTER statement is not allowed. You must modify the object when you create it.

This error occurs if you try to use an ALTER statement to rename an object in an object definition or a deployment script. For example, this error would occur if you have a stored procedure that contains the statement ALTER LOGIN LoginName **WITH NAME=**NewLoginName. Instead of renaming the login in the stored procedure, you must specify the appropriate name when you create the login.

To correct this error

  1. Open the file in which the object is created.

  2. Specify the object name that you want.

See Also

Tasks

How to: Modify Database Objects

Concepts

Troubleshooting Data Generation Issues

Other Resources

How to: View Database Objects