The stored procedure that performs a CTE in production is being executed using a service account. However, the stored procedure returns empty and I tried checking this using SSMS but I my domain account has no execute functionality in production.
I tried logging into SQL Server Management Studio using the service account but I ran through some problems. First was resolved by following this link – The certificate chain was issued by an authority that is not trusted
However, once that is executed, it returns as if no user name was provided:
Question is, can I login using a service account in SQL Server Management Studio?
Best Answer
How To Add A Service Account To Microsoft SQL Server
For further your ref here and here