If you’re using Windows Authentication for your SQL Server database you’ll need to run SQL Server Management Studio (SSMS) as that Windows account to test queries. SSMS normally runs as the user logged in to Windows, but there is a simple way to run it as the database access account.
Just shift-right-click on a shortcut and select “Run as a different user“. (Windows 7)
You’ll be presented with a Windows login prompt. Log in and SSMS will open. Note that the connection dialog has the new user in the Windows Authentication area
Note: You’re now running the program as a different user, so it probably won’t have access to the files you normally use. My fix was to give the account read/write to the folder where I hold my SQL scripts.
This tip will work for other programs too. Let me know how you used it in the comments below.