Monday, March 04, 2013

Sub Account Floppy Download Error

Error:
         while Floppy download at HO Sub account module it shows an error message Error Reading the file "Subscript out of range"

 There are more columns in the INSERT statement than values specified in the VALUES clause.

Solution:

  • Download and execute attached Script




Restore SQL Server 2008 Database Backup To SQL Server 2005

Problem:

               If you are trying to restore database backup of SQL Server 2008 to SQL Server 2005, you are bound to fail. Database backup of SQL Server 2008 is not compatible backward, you cannot restore it to SQL Server 2005. The following is a solution to convert databases of SQL Server 2008 to 2005.

Procedure to Restore SQL 2008 Database to SQL 2005:

Step by Step Guide

Step 1:Start convert wizard

Open SQL Server Management Studio2008. in 'Object Explorer', right click the database that you want to convert. Select 'Tasks' > 'Generate Scripts...'

Step 2: Next

Click 'Next'.

Step 3: Select database and objects

Select the database that you want to convert, and check on 'Scripts all objects in the selected databases'

Step 4: Convert Options

Set options:

'Script for Server Version' = 'SQL Server 2005''Script Data' = 'True''Scirpt Database Create' = 'True'
    

Step 5: Output Option

Select option 'Script to file', 'Single file' and 'Unicode text'.


Step  6: 'Finish'

View summary and click 'Finish'.

Step 7: Result

Now you got a complete database creation script with data. It can be executed on target database server.

Step 8: Amend Script

Open the generated script in SQL Server Management Studio 2005. Find the following section and amend the path to proper data folder


  CREATE DATABASE [StockTraderDB] ON  PRIMARY 
( NAME = N'StockTraderDB', 
FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\StockTraderDB.mdf ,
 SIZE = 4352KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'StockTraderDB_log', 
FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\StockTraderDB_log.LDF',
 SIZE = 6272KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)

Step 9:Execute the Script

When finished, You should get converted database of SQL Server 2005.