0

I am trying to migrate SQL Server 2017 which is running on on-premise to Google Cloud SQL. I have created the cloud instance & imported my current database backup to it. Now all working fine and able to connect applications to database without any issues except the below one.

Many of the stored procedures in my application is using some custom error messages which was added with the command exec sp_addmessage .... But I am not able to run this in Cloud SQL Database since the user don't have sysadmin privilege. When I checked the google cloud documentation for SQL Server it is mentioned as below

enter image description here

For this case there is any workaround(or options) available to run exec sp_addmessage ... and continue to work all as expected?

UPDATE:

As per the confirmation from GCP Support, currently there is no option to solve this issue by adding custom messages in Cloud SQL Server instance, but may introduced in future*. So in my case if I want to proceed with Cloud SQL Server only option is to change the code, otherwise needs to setup and maintain SQL Server manually with a **Compute Engine** instance.

Girish007
  • 442
  • 6
  • 26
  • 1
    Use `THROW` instead? Then you don't need to store the errors. – Thom A Jul 26 '21 at 06:50
  • @Larnu there are many stored procedures already with some error message logic related to this and running in production as well. so changing code will be difficult at this stage. – Girish007 Jul 26 '21 at 08:41
  • Then get `sysadmin` privileges to add the errors; those are your options. `THROW` has been recommended over `RAISERROR` for some time now anyway, so seems like it's time to bite the bullet. – Thom A Jul 26 '21 at 08:45
  • I cannot find an option to get `sysadmin` privilege and it is stated in the documentation as well. So is it the **disadvantage of Google Cloud SQL?** & cannot recommend for already existing products which are using these type of code and planning for hassle-free migration? – Girish007 Jul 27 '21 at 01:07
  • 1
    This seems to be a limitation on Cloud SQL due to the permissions, maybe raising a feature request for this over [here](https://cloud.google.com/support/docs/issue-trackers) could be useful to have this on the future. – rsalinas Jul 27 '21 at 09:49
  • @rsalinas Thanks for the link. I have raised the request with all the details. If adding such feature will be helpful for the projects those migrated PLSQL to T-SQL with this approach – Girish007 Jul 28 '21 at 03:14

0 Answers0