How to open sql server management studio by using sql server authenticaion by using vba
Hi Experts,
I am using below code to open ssms by using windows authenticion. But how can i open ssms by using sql server authenticaion via vba. Please anyone tell me the solution.
Sub Open_ModScript()
Dim rc
rc = Shell("ssms.exe -S CHNMCT123456D -d sample -E ")
End Sub
Thanks
Microsoft ExcelMicrosoft SQL Server 2008
Last Comment
venkatesh ks
8/22/2022 - Mon
Rgonzo1971
Hi,
Maybe
Sub Open_ModScript() Dim rc rc = Shell("ssms.exe -S CHNMCT123456D -d sample -U theUser -P thePW") End Sub
in the above code i replaced my server name, database name, userid and password of the server. But it should not work. Sql server management studio shows a dialog box of usage. The usage box contain below code as,
Just tested with SSMS 2016 from the cmdline, and it works for me as expected. Even if the DB is wrong (does not exist), SSMS opens up with a connected query window.
Maybe
Open in new window
Regards