Import json file to sql server

I have 1000 records in text file. My requirement is to insert data into sql server. For that, if i can convert to xml or push to script component also fine.
Text file consists in this format...
[{"ID":1,:"Name":"test1","State":"AP"},{"ID":2,:"Name":"test2","State":"KN"}{"ID":3,:"Name":"test3","State":null}]
I'm new to coding. This is the code I wrote in scriptcomponent.
#region Class
[Micorosoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryAttribute]
public class ScriptMain: UserComponent
public override void CreateNewOutputRows()
string jsonstring = System.IO.File.ReadAllText(@"c:\t.txt");
WorkGroup[] outPutMetrics = new GetWebService(wUrl);
foreach (var metric in ouPutMetrics)
TDBuffer.AddRow();
TDBuffer.ID = metric.id;
TDBuffer.Name = metric.nm;
private WorkGroup[] GetWebService(string wUrl)
WorkGroup [] jsonResp = null;
string jsonstring = System.IO.File.ReadAllText(@"c:\t.txt");
JavaScriptSerializer sr = new JavaScriptSerializer();
jsonResp = sr.Deserialize<WorkGroup[]>(jsongstring.trim('"');
return jsonResp;
#endregion
#region JSON Class
class WorkGroup
public string id {get; set;}
public string nm {get; set;}
#endregion
I'm getting these errors when I build solution -
Expected class, delegate, enum, interface, or struct
Identifier expected
Expected class, delegate, enum, interface, or struct
Identifier expected
Type or namespace definition, or end-of-file expected
The type or namespace name WorkGroup could not be found (are you missing a using directive or an assembly reference")
GetWebServiceResult does not exist in the current context
The name wUrl does not exist in the current context

This is my input file -
[{"ID":1,"Name":"test1","State":"AP"},
{"ID":2,"Name":"test2","State":"KN"},
{"ID":3,"Name":"test3","State":null}]

Similar Messages

  • Importing excel file to SQL Server

    I have an application that needs to import an excel file with
    10 columns of data into an SQL Server database table with 13
    columns of data. Two of the 3 extra database columns are manditory,
    and I need to manipulate the values going in.
    I've determined the best method to do this using coldfusion
    is to import the excel file into a cvs file then use SQL to import
    the cvs file into SQL server. Does anyone know how to import an
    excel document into a cvs file using ColdFusion?
    Thanks!

    A couple of things come to mind. You might consider using DTS
    to import your data directly into SQL Server from Excel, rather
    than putting ColdFusion in the middle. Or, you might consider
    creating a ColdFusion ODBC datasource out of your Excel file, use a
    cfquery to select the applicable data, then insert the data into
    SQL Server in a loop. Not very efficient, but it can be done.
    Phil

  • Best way to import csv file into sql server

    Hello DBAs
    always thankful for your help and one question, what is the best way to import a csv file into sql server ?

    and there is a
    Bulk Insert Task for the Control Flow.
    http://www.youtube.com/watch?v=ACuCU6IqO50
    Please mark the post as answered if it answers your question | My SSIS Blog:
    http://microsoft-ssis.blogspot.com |
    Twitter

  • Error importing text file into SQL Server when last column is null

    Hello all. Happy holidays!
    I'm trying to import a text file into a SQL Server table, and I get the error below when it gets to a row (row 264) that has null in the last column. I'm guessing the null jumbles up the delimiters somehow. The nulls are not errors, and I need to import
    them into the table with the rest of the rows. Any idea how I can do that?
    Thanks!
    [Flat File Source [1]] Error: Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
    [Flat File Source [1]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "output column "XYZ" (178)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "XYZ"
    (178)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    [Flat File Source [1]] Error: An error occurred while processing file "ABC.txt" on data row 264.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "Flat File Source" (1) returned error code 0xC0202092.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    WeeLass

    Hi WeeLass,
    The error that” Data conversion failed. The data conversion for column "XYZ" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".” is generally error message, and the error indicates
    that there is data type mismatch issue between the input columns and the output columns.
    Based on your description, the issue is that you trying to convert a column contains empty value from string to integer data type for the output column "XYZ" in Flat File Source [1]. Please note that we cannot type an empty value as integer data
    type column value, so the error occurs.
    To fix this issue, just as you did, we should convert the data type for the output column "XYZ" in Flat File Source [1] back to DT_WSTR or DT_STR, then use a derived column task to replace the current column (UBPKE542). But the expression should
    be like below:
    LEN(TRIM(UBPKE542)) > 0 ? (DT_I8)UBPKE542 : NULL(DT_I8)
    In this way, the data type of the column in SQL table would be int, and the empty value would be replaced with NULL.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Issue importing flat files into SQL server 2008R2

    I have csv files that the last column may not have data. SSIS (version 2008R2) will insert the next row's data into the empty cells, which causes my package to fail.
    I know this is resolved in 2012 but we are using 2008R2 still. Any suggestions?
    Thanks.

    Hi sqlBI2014,
    After testing the issue that Flat File Connection Manager cannot handle file with uneven number of columns in each row in my SQL Server 2008 R2 environment, I can reproduce it.
    Based on my research, the issue is caused by the Column Delimiter gets first preference and then Row delimiter. So the next row data would be inserted in the empty column cell. This is by design in SQL Server 2005, SQL Server 2008 or SQL Server 2008 R2.
    Good news is that the issue is fixed in SQL Server Data Tools which comes with SQL Server 2012. In SQL Server 2012, by default, the Flat File Connection Manager always checks for a row delimiter in unquoted data, and starts a new row when a row delimiter
    is found. This enables the connection manager to correctly parse files with rows that are missing column fields.
    If you still want to fix the issue in SQL Server 2008 R2, there is a sample component posted to the CodePlex that might help you with this:
    http://ssisdfs.codeplex.com/
    References:
    http://blogs.msdn.com/b/dataaccesstechnologies/archive/2013/03/13/flat-file-source-cannot-handle-file-with-uneven-number-of-columns-in-each-row.aspx
    https://connect.microsoft.com/SQLServer/feedback/details/293193/ssis-import-of-flat-file-with-uneven-number-of-columns
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Import multiple files using sql server management studio

    Using sql server management studio I want to do 2 things.
    - Import all txt files from a directory as tables into my DB.
    - Add an additional field to each new table which contains the table name.
    Can anyone help me?

    There are couple of ways to do it:
    File naming conventions : YourFileName_SystemId.txt
    You can create one extra column in table or may be name a table with system id. Then after loading the data you can update that column with the system id.
       components required:
     ForEachLoopContainer - To get file and store file name in a variable
     Expression Task (if SSIS 2012 or above) or variable expression or script task to seperate file name from systemId
     Data Flow Task - to load data
     Execute SQL Task - to update last column or specific table based on precedence constraints  
    Note: You can also add extra column in data flow via
    derived column transformation.
    Ex.:
    Load file via foreach loop
    Split string via seprator
    2: Loading different system file in different folder
    you can have predefined folder structure ex: SystemId1, SyetemId2 etc and can download respective txt file in their system folder. Then you can easily identity which file belong to which system and then load it to the respective table.
    3: Use first row of text file to hold the system value
    Use first row to have the system id and then skip row while fetching data. 
    Note: Then you have to read first row through script task to get the system id.
    hope this will help

  • Problem in bulk import of text files in SQL Server

    Hi,
    I am using sql server 2012 x 64 and trying to import some text files (tab/ comma separated) and ms access files in sql server tempdb
    I am trying bulkinsert on text file but it is inserting all data in a single line in sql while in text file I have 1000K lines,
    Then I tried importing other data using openrowset from access file but I am getting following error
    Cannot create an instance of OLE DB provider "MSDASC" for linked server "(null)".
    can any one please provide some assistance . If I am able to upload the data from flat text file then it will be enough as I am getting data in tsv or csv format
    Nitin

    If this is a one-off, I think you should try the import/export wizard in SQL Server Management Studio instead. This may be easier to get working.
    If you want to this import on a regular basis with BULK INSERT, we need to see the CREATE TABLE statement for your table and a sample file. Best if you can upload the file on Skydrive, Dropbox or similar, as the exact bytes matters.
    To connect to an Access database, you use the ACE provider. Never heard of MSDASC before.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Importing Data From XLS File to SQL Server

    Dear All,
    I want to import the data from Excel(.xls) file to SQL Server (2008 R2). But due to some problem (may be data), an error is occurring when I am going to import using Import Data Wizard. I want the rows to ignore those are creating issues and to keep track
    of those records. That's why I need to process rows one by one. How can I do it? Any idea?
    Thanks & Regards,
    Anujit Karmakar
    Anujit Karmakar Sr. Software Engineer

    Whats the error? Have you mapped the source-destination data types  in column mappings?
    Below is a link to video to guide you through the Steps of Import/Export Wizard
    SSIS Wizard Video: http://www.youtube.com/watch?v=9Wmdhnx1niU
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other
    forum members can benefit from it 

  • SSMS 2012: Import XML File to SQL Table - 'value' is not a recognized built-in function name!!??

    Hi all,
    I have the following xml file (books1.xml):
    <bookstore>
    <book>
    <BookID>1</BookID>
    <title>Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    <book>
    <BookID>2<BookID>
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
    </book>
    <book>
    <BookID>3<BookID>
    <title>XQuery Kick Start</title>
    <author>James McGovern</author>
    <year>2003</year>
    <price>49.99</price>
    </book>
    <book>
    <BookID>4<BookID>
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
    </book>
    </bookstore>
    In my Microsoft SQL Server 2012 Management Studio, I executed the following SQL Query code:
    --XQuery w3schools example using books1.xml in C:\Temp folder
    ---SQL Query W3books Title
    ---9 March 2015
    USE XML_XQUERY
    GO
    CREATE TABLE W3Books(
    BookID INt Primary Key,
    Title VARCHAR(30));
    INSERT INTO W3Books (BookID, Title)
    SELECT x.book.query('BookID'), value('.', 'INT'),
    x.book.query('title'), value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'C:\Temp\books1.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('W3Books/book') AS x(book);
    SELECT BookID, Title
    FROM W3Books;
    I got the following error messages:
    Msg 195, Level 15, State 10, Line 7
    'value' is not a recognized built-in function name.
    Msg 156, Level 15, State 1, Line 16
    Incorrect syntax near the keyword 'AS'.
    I don't know why I got the error of 'value' is not a recognized built-in function name. Please kindly help and tell me what is wrong in my code and how to correct the error.
    Thanks, Scott Chang
    P. S.
    (1) I mimicked the xml file and SQL Qeury code of Import XML File to SQL Table in
    http://pratchev.blogspot.com/2008/11/import-xml-file-to-sql-table.html. The xml file and the code of this sample worked in my SSMS 2012 program.
    (2) I am learning the "CAST" and "CROSS APPLY" in the Create Instances of XML Data of Microsoft MSDN - it is very abstract to me.

    Hi Stan210, Thanks for your nice response.
    I corrected my xml file as you pointed out.
    I made some changes in some code statements of my SQLQueryW3BookTitle.sql as you instructed:
    --XQuery w3schools example using books1.xml in C:\Temp folder
    ---SQL Query W3books Title
    ---10 March 2015
    USE XML_XQUERY
    GO
    CREATE TABLE W3Books(
    BookID INt Primary Key,
    Title VARCHAR(30));
    INSERT INTO W3Books (BookID, Title)
    SELECT x.book.value('/BookID[1]', 'INT'),
    x.book.value('/title[1]', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'C:\Temp\books1.xml',SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('bookstore/book') AS x(book);
    SELECT BookID, Title
    FROM W3Books;
    I executed my revised sql and I got the following Message and Results:
    Msg 515, Level 16, State 2, Line 6
    Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls. INSERT fails.
    The statement has been terminated.
    (0 row(s) affected)
    Results:
    BookID    Title
    I don't know why I just got the names of columns in Results and the "Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls, insert fails." in Messages.  Please kindly help, advise me
    how to correct the errors and respond again.
    Many Thanks again,
    Scott Chang

  • Periodic Importing of data from SQL Server into Oracle Database

    I would like to know how I can use the SQL Developer tool to import data from a SQL Server database across the internet into an Oracle Database on a periodic basis? I understand there is a Migration Workbench, but it seems to be only a one off activity.
    What I would really like is to be able to import data for example, very 30 minutes from multiple tables/views in a SQL Server Database into an Oracle Database (overwriting or modifying existing same data) without the need for Heterogeneous Connectivity, as my Oracle Database is not my LAN.
    Thank you for your kind ideas and suggestions.

    To be honest the best way to do it is DG4ODBC or DG4MSQL. All other solutions need manual interaction.
    The gateways DG4ODBC and DG4MSQL are independant from the Oracle database and also from the SQL Server location. In a worst case scenario you have an Oracle database on machine A, the gateway on machine B and the SQL Server on machine C.
    Gateways were built to exactly do what you want. As you have access to the Oracle database the only part you need to define within the Oracle database is a db link. If you specify the full tns connect identifier there is even no need to edit the tnsnames.ora file.
    Even if you excluded the gateway in your last sentence the best solution would be the gateway.
    Another option you can use is the SQL Server linked server mechanism. It allows you to link another server using OLEDB driver. In your case you can then link the Oracle db into your SQL Server and then insert/update/delete and select Oracle tables from the SQL Server. Using now a trigger will replicate the data immediately to the Oracle db.

  • Import HL7 data in sql server using ssis

    Could I know how to import HL7 data in sql server using ssis.
    I am not aware of any .NET code.
    Could someone provide me with any kind of custom code so I can try to understand and use it to my specifications.
    Thanks
    Latha

    As COZYROC said, HL7 is a type of EDI file. There is nothing built into SQL Server to handle this type of parsing.  You will either need to buy something or write your own, which I do not recommend because it is much more difficult than you imagine.
    You can use BizTalk to parse the data into an XML format which can then be processed by SQL Server.
    http://msdn.microsoft.com/en-us/library/bb981217(v=bts.10).aspx

  • Skip bad row during importing large dump into sql server

    Hello,
    I have an issue during importing very large (more than 3 GB) dump file into sql server express. I have used command line for this purpose. Unfortunately this file was exported in UTF-8 so I had to convert it unicode. The unicode columns contain N' prefix.
    Unfortunately the file contains apostrophes in other fields as well.
    My question is: Is there an opportunity to skip bad rows during importing? (Force import e.g.)
    Sincerely, Laszlo Toth

    >>>Unfortunately the file contains apostrophes in other fields as well.
    You can concatenate the single quote using the CHAR function to build the string:
    SELECT N'Brian O'+CHAR(39)+'Brien'
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to link Excel 2010 .XLSX file to SQL server 2008R2 - a method that actually works?

    I have been trying unsuccessfully to link my excel file to SQL server like I used to with SQL 2005.
    In SQL 2008R2 I have installed the 64-bit data access components from Office 2010 to get the  provider 'Microsoft.ACE.OLEDB.12.0' avilable.
    When I try this command:
    SELECT
    FROM
    OPENDATASOURCE(
    'Microsoft.ACE.OLEDB.12.0',
    'Data Source="E:\ADUpdates\Employee List1.xlsx"; Extended properties=Excel 12.0')...[Sheet1$]
    I get this error:
    Msg 7399, Level 16, State 1, Line 1
    The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. Access denied.
    Msg 7301, Level 16, State 2, Line 1
    Cannot obtain the required interface ("IID_IDBCreateCommand") from OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
    The Access Denied error seems to be form the worksheet and not the file itself. Evidence is that if I enter a bogus sheet name it tells me the sheet doesn't exist and after this error the file is locked open and can't be saved again from Excel until the
    query windows is closed. The sheet is not protected in Excel so I don't know how access to it can be denied.
    Does anyone actually have this working in SQL 2008R2?

    Some minor progress on this issue by running SQL Server service under a domain account with Administrator priv on the SQL server.
    This query now works in a query window:
    SELECT * FROM OPENDATASOURCE( 'Microsoft.ACE.OLEDB.12.0', 'Data Source="E:\ADUpdates\Employee List.xlsx"; Extended properties=Excel 12.0')...[EmployeeData];
    However, creating a Linked server object for the same spreadsheet still does not work:
    EXEC master.dbo.sp_addlinkedserver @server = N'TEST', @srvproduct=N'Excel 12.0', @provider=N'Microsoft.ACE.OLEDB.12.0', @datasrc=N'E:\ADUpdates\Employee List.xlsx'
    The test connection to the linked server failed.
    Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "TEST".
    OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "TEST" returned message "Unrecognized database format 'E:\ADUpdates\Employee List.xlsx'.". (Microsoft SQL Server, Error: 7303)
    For help, click:
    http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=7303&LinkId=20476
    Naturally, the help link provided only confirms the contempt microsoft holds for their customers by not providing any information at all.
    (appologies for the weird colour and fonts, this is a microsoft product, just have to live with obvious defects).

  • Problem attaching mdf file in sql server 2008

    hi...!
    I have an mdf file of sql server 2005 database now i want it to attach in sql server 2008 R2 but when i try to attach it, it gave me error saying.
       Fail to retrieve data for this request. 
     An exception occur while executing a Transact-SQL statement or batch.(Microsoft.sqlServer.connectionInfo)
    C:\program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file6.mdf is not a primary database file. (Microsoft SQL Server, Error:5171)
    Thanks in advance

    hi...!
    I have an mdf file of sql server 2005 database now i want it to attach in sql server 2008 R2 but when i try to attach it, it gave me error saying.
       Fail to retrieve data for this request. 
     An exception occur while executing a Transact-SQL statement or batch.(Microsoft.sqlServer.connectionInfo)
    C:\program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file6.mdf is not a primary database file. (Microsoft SQL Server, Error:5171)
    Thanks in advance
    Hello,
    As the message says the file is not primary data file ,i guess it must be ndf(secondary data file) or some other file you might have selected by mistake.PLease select primary data file and try attching you will succed
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Error in sql_engine_core_inst_Cpu64_1.log file for SQL Server 2012

    I was running SQL Server 2012 in Win 7 64 bit OS. Some how I found SQLSERVER server is not running and I was not able to run the service. Then I tried to unisntall and install again. And I found that some of the SQL Server
    features got failed,  like: Reporting Services - Native, Database Engine Services, Data Quality Services, Full-Text and Semantic Extractions for Search and SQL Server Replication. I checked the Summary.txt
    file from location C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log. It thsi logs referes to another log file location like: 
    Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred during the setup process of the feature.
      Next Step:                     Use the following information to resolve the error, and then try the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          1639
      Component log file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140127_151409\sql_engine_core_inst_Cpu64_1.log
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=sql_engine_core_inst.msi%400x162A16FE%400x1639
    I did unisntall/install multipel times. But fhw to fix the issue that saying in sql_engine_core_inst_Cpu64_1.log file.: 
    === Verbose logging started: 1/27/2014  15:45:04  Build type: SHIP UNICODE 5.00.7601.00  Calling process: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\x64\ScenarioEngine.exe ===
    MSI (c) (C4:BC) [15:45:04:321]: Resetting cached policy values
    MSI (c) (C4:BC) [15:45:04:321]: Machine policy value 'Debug' is 0
    MSI (c) (C4:BC) [15:45:04:321]: ******* RunEngine:
               ******* Product: E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
               ******* Action: 
               ******* CommandLine: **********
    MSI (c) (C4:BC) [15:45:04:322]: Client-side and UI is none or basic: Running entire install on the server.
    MSI (c) (C4:BC) [15:45:04:322]: Grabbed execution mutex.
    MSI (c) (C4:BC) [15:45:04:323]: Cloaking enabled.
    MSI (c) (C4:BC) [15:45:04:323]: Attempting to enable all disabled privileges before calling Install on Server
    MSI (c) (C4:BC) [15:45:04:323]: Incrementing counter to disable shutdown. Counter after increment: 0
    MSI (s) (38:8C) [15:45:04:327]: Running installation inside multi-package transaction E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
    MSI (s) (38:8C) [15:45:04:327]: Grabbed execution mutex.
    MSI (s) (38:A0) [15:45:04:327]: Resetting cached policy values
    MSI (s) (38:A0) [15:45:04:327]: Machine policy value 'Debug' is 0
    MSI (s) (38:A0) [15:45:04:327]: ******* RunEngine:
               ******* Product: E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
               ******* Action: 
               ******* CommandLine: **********
    MSI (s) (38:A0) [15:45:04:452]: Machine policy value 'TransformsSecure' is 0
    MSI (s) (38:A0) [15:45:04:452]: User policy value 'TransformsAtSource' is 0
    MSI (s) (38:A0) [15:45:04:475]: Machine policy value 'DisableUserInstalls' is 0
    MSI (s) (38:A0) [15:45:04:475]: Specified instance {18B2A97C-92C3-4AC7-BE72-F823E0BC895B} via transform :InstID01.mst;:InstName02.mst is already installed. MSINEWINSTANCE requires a new instance that is not installed.
    MSI (s) (38:A0) [15:45:04:475]: MainEngineThread is returning 1639
    MSI (s) (38:8C) [15:45:04:477]: User policy value 'DisableRollback' is 0
    MSI (s) (38:8C) [15:45:04:477]: Machine policy value 'DisableRollback' is 0
    MSI (s) (38:8C) [15:45:04:477]: Incrementing counter to disable shutdown. Counter after increment: 0
    MSI (s) (38:8C) [15:45:04:478]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2 
    MSI (s) (38:8C) [15:45:04:478]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2 
    MSI (s) (38:8C) [15:45:04:478]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MSI (s) (38:8C) [15:45:04:478]: Restoring environment variables
    MSI (c) (C4:BC) [15:45:04:481]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
    MSI (c) (C4:BC) [15:45:04:481]: MainEngineThread is returning 1639
    === Verbose logging stopped: 1/27/2014  15:45:04 ===
    Please advice. I searched many places and did not get actual solution that will resolve my case.
    Nusrat Akhter

    Hi Nusrat Akhter,
    According to your description, when installing the first install failed, and it looks like the instance did not uninstall completely. To solve the issue I recommend you changed the instance name in re-installing SQL Server, and check if it can work fine.
    There is a similar issue that the SQL engine will not start, and there is no method of uninstalling either it, or any of the components etc. You can review the following post.
    https://connect.microsoft.com/SQLServer/feedback/details/710892/sql-server-2012-rc0-install-fails-citing-invalid-drivers
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

Maybe you are looking for