Command-line options connecting SQL server

My collegue and I were searching for a handy solution to login with a different account then the login-account for the server. We find the following solution:

image

But this can be automated using the command-line options. If you like to see the list of available command-line options, go to Start > Run > type “SSMS /?”:

This will display the all available options which can be used with SSMS,

image

The options are self-explanatory, the -E is used for Windows Authentication. – U, – S are used for SQL Server Authentication Both should be mutually exclusive. if you used together the SQL Server Authentication will take precedence. for example, to connect to default instance of local SQL Server execute below from Start > Run or from CMD.

 SSMS S(local) –E
– connect to default instance using Windows Authentication

 

SSMS S(local)\InstanceName –E
– connect to named instance using Windows Authentication

 

SSMS S(local) U sa P P@$$w0rD
– connect to default instance using SQL Server Authentication

 

SSMS S(local) E U sa P P@$$w0rD
– connect to default instance using SQL Server Authentication
– SQL Server Authentication takes precedence

 SSMS S(local) E C:\MyQuery.sql
– connect to default instance using Windows Authentication
– and open a saved query file

 SSMS S(local) d AdventureWorks2008R2 E
– connect to default instance using Windows Authentication
– and change context to AdventureWorks2008R2 database

 All the options described above are for SQL Server 2008. The same options can be used with SQL Server 2005. However, for SQL Server 2005, replace SSMS.exe with SqlWb.exe.

This article was written down by Vishal

Mount and unmount wim-file

How use DISM for mounting a wim-file? With the following example I will show you how to do:

  • The name of the wim-file is LTI_WIN7_64.wim
  • The test location is C:\Test
  • the location of the wim-file is: D:\RemoteInstall\Boot\x64\Images
  1. Open een elevated prompt.
  2. Go with the following command to the directory mentioned earlier cd “D:\RemoteInstall\Boot\x64\Images” [enter]
  3. dism /mount-wim /wimfile:LTI_WIN7_64.wim /index:1 /mountdir:”C:\Test”
  4. Go by Explorer to C:\Test. You can also see the content of the wim-file

How use DISM for mounting a wim-file? With the following example I will show you how to do:

  1. Close all browser sessions to the mount-location
  2. Open een elevated prompt.
  3. Go with the following command to the directory mentioned earlier cd “D:\RemoteInstall\Boot\x64\Images” [enter]
  4. dism /unmount-wim  /mountdir:”C:\Test” /discard

 

 

An error occurred while attempting to read the boot configuration data. (WDS/MDT)

This morning I would like to re-image a laptop from a customer, but my imaging free Microsoft environment doesn’t work. I got the error “An error occurred while attempting to read the boot configuration data.”. After a few minutes I found the cause of this error. In MDT my boot images was present but disabled. I didn’t know how the boot images was set off. But I enabled the boot image by right click/enable and the image runs again without an error.

Boot Manager Error