Hi I'm noticing some odd behavior while using SMO and was wondering if anyone could provide some insight into this; when I first make any call to the Server.JobServer property (in this case, merely calling .ToString() which presumably lazy initializes it in the background) I find that it's affected my SQL connection string - specifically the password has disappeared!
Below is the code I use to produce this behavior:
SqlConnection conn = new SqlConnection(@"Data Source=myserver;Initial Catalog=Stage;user=myuser;password=abc;");
ServerConnection serverConn = new ServerConnection(conn);
Server server = new Server(serverConn);
Console.WriteLine(conn.ConnectionString);
server.JobServer.ToString();
Console.WriteLine(conn.ConnectionString);
The output from this is Data Source=myserver;Initial Catalog=Stage;user=myuser;password=abc; Data Source=myserver;Initial Catalog=Stage;user=myuser;
The account myuser is configured with the public and sysadmin SQL Server Roles and has dbo on master and msdb. Could anyone provide any insight or clues as to why this is happening?