Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Username hard coded in migration #52

Open
ian-cameron opened this issue Mar 21, 2019 · 2 comments
Open

SQL Username hard coded in migration #52

ian-cameron opened this issue Mar 21, 2019 · 2 comments

Comments

@ian-cameron
Copy link
Contributor

This SQL Server Agent Job looks useful, however it is hard coded to be owned by user 'SPM', so if your server doesn't have a user name 'SPM' it will make migrations fail in a non-obvious way with an error like

  System.Data.SqlClient.SqlException: The specified '@owner_login_name' is invalid (valid values are returned by sp_helplogins [excluding Windows NT groups]).

The workaround is create a user name SPM (you don't even have to change your connection string in the config file), or change this line in the code to match the username you're using in your connection string.

Hope this saves someone time.

@owner_login_name=N'SPM', @job_id = @jobId OUTPUT

@udotdevelopment
Copy link
Owner

We have had some issues with this script that we are continuing to refine. There are some assumptions being made. You are correct that the user is one of those. Another is that you are using month partitions on your speed and controller_event_logs tables. We were hoping that those who may be interested in using it could take it and modify it accordingly. We will try to put together a document to help with this in a future release.

@dbrandesky
Copy link

This fixed my issue #63! I spent like 3 days trying to figure this out. FWIW, I did also need to give the 'atspm' user I created sysadmin privileges to get around the initial issue I found (not able to SELECT or EXECUTE in the msdb database).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants