Using the code
Step 1. Copy/type the below given SQL.
Step 2. Change @DBName to < Database Name>, @DBName_log to
Step 3. Execute the SQL.
ALTER DATABASE @DBName SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE(@DBName_log, 1)
ALTER DATABASE @DBName SET RECOVERY FULL WITH NO_WAIT
In SQL Server data is stored using two physical files:
- (.mdf) extension which contains the data.
- (.ldf) extension which contains log.
Log file size increases very rapidly and depend on the operation performed on the data. After a long time period this file becomes too large. When log file is too large it takes time to perform some operations like ( attach , de-attach, backup, restore … etc ).
This is a quite simple task ..
Assuming you have an MDF file called cxnMassImport.mdf and you want to attach it using osql.exe.
Open a CMD
osql.exe -E -S .\SQLExpress
How to Change the Default Login Authentication Mode to SQL
use SECURITYMODE=SQL as command line setup parameter when installing SQL Server
change one of the following registry keys:
HKLM\Software\Microsoft\Microsoft SQL Server\ Instance Name\MSSQLServer\LoginMode
to 2 for mixed-mode or 1 for integrated security. (Integrated is the default setup for the SQL Server 2000 Data Engine.)
for more refer to article MS Q285097
Tried to start Microsoft SQL Server Enterprise Manager and got stuck at the error message General OLE Error 16386:
try this, maybe this solves the issue..
a. Stop all SQL Server services (MSSQLServer, SQLServerAgent, MSSEARCH)
b. Open command prompt and go to the %ProgramFiles%\Microsoft SQL Server\80\Tools\Binn directory
c. Unregister the following .dll files (Ex. regsvr32 /u dtsui.dll): dtsui.dll,sqlns.dll, sqldmo.dll, sqllex.dll, sqlmmc.dll
d. Copy and paste the .dll files from a CD (under x86\Binn directory) to the Program Files\Microsoft SQL Server\80\Tools\Binn
e. Register the .dll files (Ex. regsvr32 sqldmo.dll)