start /wait C:\SQLSERVER2005\SQLEXPR32.EXE /qb username="CustomerUsername" companyname="OurCompany" addlocal=ALL disablenetworkprotocols="0" instancename="MyInstance" SECURITYMODE="SQL" SAPWD="MyPassword"
This would successfully install the sql-server 2005 express edition to the system. Now to login into the sql-server use the following command in cmd:
sqlcmd -S PC100\MyInstance -U sa -P MyPassword
After successful login we would require to attach a database. To attach a database use following command:
CREATE DATABASE MyDBName ON
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\MyDB_Data.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\MyDB_log.ldf' )
FOR ATTACH ;
GO
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\MyDB_Data.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\MyDB_log.ldf' )
FOR ATTACH ;
GO
This would successfully attach the database. Now you are ready to use the database.
Quite a nice post. It really helped me in managing the installation at the client side. Thanks !:)
ReplyDeletelooks great. The parsing of corrupted documents can be also performed by the sql recovery tools, it is the fastest way to open affected files
ReplyDeleteThis is brilliant !!! Thanks for the code. Just to add one more thing this type of silent installation is also known as unattended installation. Good work Jai.
ReplyDeleteThanks @Meera for the update. You are right, the silent installation is also known as un-attended installation, no-interaction installation and one-click installation.
ReplyDeleteThank you very much for your article.
ReplyDelete