SQL Database is corrupted

 unfortunately hard disk of my system is damaged, now i recovered my database. but it cannot be attached again to SQL management studio 2005.
  the error is
 myfile.mdf is not a primary database file. (SQL server , error 5171)

not a primary database file. (Microsoft SQL Server, Error: 5171) ? 
The aforementioned error message conveys that the database is corrupt and is, therefore, not accessible. 
Cause: 
The root cause of this error message is that the database file is corrupt. It may be possible because of various reasons such as power surges, human errors,
virus infections, etc. 
Resolution: 
To address this issue, there are few things that you can perform. First of all, take a backup of this corrupted database lest it is further damaged. Then,
you should try to check the database consistency using the DBCC CHECKDB utility. For this, you should run the utility without any clause. The command is executed and the reason for corruption is provided. Then, run the utility using the mentioned clause. However,
if you are still not able to repair sql, then you should use a third-party ms sql repair tool for mdf repair. Such tools recover corrupted SQL database components after all kinds of logical crash scenarios. 
SQL Recovery software is a robust tool that is used to recover corrupt databases created in MS SQL Server 2000, 2005, and 2008. It is able to repair sql
components such as tables, defaults, stored procedures, triggers, views and rules. It can also repair database constraints such as primary key, foreign key, unique key, check, etc. It is a highly interactive tool that does not overwrite the original database
while scanning it. It is compatible with Window 7, Vista, 2003 Server, XP, 2000, and NT.

Similar Messages

  • SQL Database is corrupted....... plz help.

    Respected Sir,
    unfortunately hard disk of my system is damaged, now i recovered my database. but it cannot be attached again to SQL management
    studio 2005.
    the error is myfile.mdf is not a primary database file. (SQL server , error 5171)
    plz sir help me...

    Corruption in SQL server database can happen due to any uncertain like virus attack, power
    failure, hardware issue, OS malfunction, sudden system shutdown, so on. When a SQL server data file (.mdf) is corrupt then DBAs can try several methods to repair and recover data from it. 
    Run DBCC CHECKDB: It checks & reports all the error message
    in errorlog, if there is any problem with the database. Try to analyze & understand the error message logged in the errorlog. Re-run DBCC CHECKDB with the recommended minimum repair option to repair the file. 
    Detailed information about DBCC CHECKDB is available here: http://www.techrepublic.com/forums/discussions/sql-database-recovery-from-corrupt-database-file/
    Restore from backup: If above command fails to fix the error
    message the try to restore the database from clean backup. 
    3rd party tool: Try 3rd party
    Recovery Toolbox for SQL Server to recover data from corrupt mdf file. Most of the software have demo version that shows the preview of corrupt SQL server data file. 
    http://www.sql.recoverytoolbox.com/

  • What do corrupted sql database viewer ?

    There MS SQL 2005 server and a database that you want to connect to the server.
    There mdf ldf and files. The problem is that, most likely, the base was incorrectly disabled, and now when you try to connect the message:
    File activation failure. The physical file name "C: \ Program Files \ Microsoft SQL Server \ MSSQL.1 \ MSSQL \ Data \ GB_main_log2.ldf" may be incorrect.
    The log can not be rebuilt because the database was not cleanly shut down. (Microsoft SQL Server, Error: 5120)
    What do corrupted sql database viewer ?

    Hi VectoriaKoalak,
    As other post, the best bet is to restore the database from a good backup.
    However, if you have no backups or have damaged backups.  To fix the database, you can set the database in Emergency Mode and run DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option to fix up corruptions. For more detailed steps, please review
    the following blog.
    EMERGENCY-mode repair: the very, very last resort
    http://www.sqlskills.com/blogs/paul/checkdb-from-every-angle-emergency-mode-repair-the-very-very-last-resort/
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • OAF Update of Custom Table causing ORA-600 with database block corruption?

    Using OA Framework 12.1.3, running under EBusiness Suite 12.1.3
    Created Custom Web page operating against Custom Tables
    ISSUE
    On about 2% of new records, when OAF is UPDATING a record in a certain table, it  is failing with
    java.sql.SQLException: ORA-00607: Internal error occurred while making a change to a data block
    ORA-00600: internal error code, arguments: [kddummy_blkchk], [815], [26412], [6110], [], [], [], []
    ORA-06512: at line 1
    Before the DBA turned on 10.2.0.4.0 DB_BLOCK_CHECKING parameter, this actually
    resulted in corrupted data blocks in the database and corrupted indexes that
    eventually crashed the database and we had to do a full recovery with 2 days downtime.
    Now that we have turned on DB_BLOCK_CHECKING, it simply errors out and puts things
    in the alert log, but the records still fail to update as the writes are blocked.
    Then oddly, a few days later.. the records become editable.  And others fail.
    This is ONLY happening on the one particular table being updated by OAF.  Other custom pages
    posting to other custom tables are having no problems.   We've CTAS'd the table back and
    forth and recreated the indexes, and that did not help.
    Support says to post to the Forum  ( So I am! ) or hire Oracle consulting.. which doesn't make
    much sense given the error.  The Recovery Team that helped us in a separate SR ( we had
    to do db_repairs not just recovery ) felt it was an important problem the OAF team needed to
    strongly review.
    Anyone else encounter this already and know of a solution?
    TIA
    Karl

    After MANY hours of trial and error and research, we've identified ONE use case that seems to apply to 90% of the issue we have encountered.
    YMMV.
    The BC4J generated SQL which is generating the ORA-600 is
    BEGIN UPDATE XXRETURNHEADER ReturnHeaderEO SET INTERNAL_TEXT=?,LAST_MOD_USERNAME=?,OBJECT_VERSION_NUMBER=?,LAST_UPDATE_DATE=?,LAST_UPDATED_BY=?,LAST_UPDATE_LOGIN=? WHERE RMA_NUMBER=? AND ORGANIZATION_ID=? RETURNING TROUBLESHOOT_DATE, FAA_TAG_DATE, FAILURE_ANALYSIS_DATE, LAST_MOD_DATE, FAA_REVISED_DATE, TTE_TECH_SEND_DATE, TTE_REP_RESPONSE_DATE, TTE_REP_APPROVED, TTE_RMA_RANDOM_KEY, OBJECT_VERSION_NUMBER, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN INTO ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?; END;".
    We determined that if TTE_RMA_RANDOM_KEY was not a null value, we would get an ORA-600 error whenever we did an APPLY from the OAF Page to update the record.
    If we set that table attribute to NULL for the record using SQL.. then used the  OAF Page to APPLY.. it worked fine and the record saved without error.
    We then modified the EO to NOT   "Refresh After Update"  ( thus removing it from the RETURNING clause generated )... and even if the TTE_RMA_RANDOM_KEY
    had a value... the OAF Page APPLY worked and the record saved without error.
    I cannot identify anything from the User programming side that is wrong ( and neither could Oracle ), and it REALLY should be in the RETURNING clause list of
    attributes.. but this is the only workaround I've found that doesn't crash the Page and irritate the user to no end.
    I have reported my findings via the SR back to Oracle to do with it what they may... but it looks strongly ,to me, to be an error in the BC4J/JDBC/Database
    coordination and passing data between those black boxes.

  • SQL database issue.

    Hi friends
    I am putting this question in XI area because I am sure many of you guys will be using BAPI's from XI side and so are familiar with the problems that we are having.
    We have an ERP server (ECC) and have created lots of database tables, functions, Abap programs etc., that works with our XI integration.
    For some reason our ERP software is corrupted. However, the SQL database looks ok.
    So here is what we want to do.
    Since the SQL database is good, So we would like to backup the SQL database first.
    We have a ghost image of the server that was done some 2 months back. So we would like to install the ghost image of the server from 2 months back. This will bring the server back to working condition but without data.
    Then recover the SQL database which we backed up before installing the ghost.
    By doing this, will we be able to get back all the tables, data elements, BAPIs, functions, ABAP programs etc.,
    Please let us know.
    I will really appreciate it.
    Thanks
    Ram

    Hello Ram,
    What do you mean by "corrupted" ? technically (db block error) or logically (customizing or workbench damaged) speaking ?
    It would be hard to answer to such difficult question, but it does not look easy to handle ... Especially because SAP stores everything in its db (sources, data, custo, etc), so if you re-load/re-import/whatever your SQL content, you will get a chance to bring the issue back into the newly recreated instance
    Otherwise, you can ask SAP for help, depending on your issue
    Sorry for such generic (non) answer
    Chris

  • SQL Database Recovery

    Hi,
    We have accidentally deleted a database from SQL server. Then we have used NTFS file recovery tools such as R-Studio and scanned the entire drive. As a result of the scanning process we found a set of MDF files. Then we tried to attach the MDF files using
    SQL Management Studio. While doing so we got an error stating "MDF File is corrupted". Then we purchased a "Kernel for SQL Database" tool and opened the MDF file using that. We were able to recover only partial data. Is there any way that
    we can recover the full data from the MDF files.
    Any help on this would be greatly appreciated.
    Thanks,
    Sairam
    Sairam Avacorp Technologies

    Hi,
    We have accidentally deleted a database from SQL server. Then we have used NTFS file recovery tools such as R-Studio and scanned the entire drive. As a result of the scanning process we found a set of MDF files. Then we tried to attach the MDF files using SQL
    Management Studio. While doing so we got an error stating "MDF File is corrupted". Then we purchased a "Kernel for SQL Database" tool and opened the MDF file using that. We were able to recover only partial data. Is there any way that we
    can recover the full data from the MDF files.
    Any help on this would be greatly appreciated.
    Thanks,
    Sairam
    Sairam Avacorp Technologies

  • Image path not storing in sql database

    Hello,
    I have read here on the forum how to upload an image to server and store path in  your database, the image uploads correctly to the correct folder on my server but the image path does not get stored on my sql database (not local hosting). I receive the error: The file has been uploaded, and your information has been added to the directory. Column 'image' cannot be null.
    My database has the following columns:
    id
    datum
    image
    sectie
    My code is as follows:
    <?php require_once('Connections/dbTroch.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_dbTroch, $dbTroch);
    $query_rs_aanbod = "SELECT * FROM tblSlideshow ORDER BY id ASC";
    $rs_aanbod = mysql_query($query_rs_aanbod, $dbTroch) or die(mysql_error());
    $row_rs_aanbod = mysql_fetch_assoc($rs_aanbod);
    $totalRows_rs_aanbod = mysql_num_rows($rs_aanbod);
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    $target = "images/slides/";  //This is the directory where images will be saved// 
    $target = $target . basename( $_FILES['image']['name']); //change the image and name to whatever your database fields are called//
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "add-photos-aanbod")) {
      $insertSQL = sprintf("INSERT INTO tblSlideshow (image, sectie) VALUES (%s, %s)",
                           GetSQLValueString($_POST['file'], "text"),
                           GetSQLValueString($_FILES['image']['name'], "text"));
    //This code writes the photo to the server//
    if(move_uploaded_file($_FILES['image']['tmp_name'], $target))
    //And confirms it has worked//
    echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
    else {
    //Gives error if not correct//
    echo "Sorry, there was a problem uploading your file.";
      mysql_select_db($database_dbTroch, $dbTroch);
      $Result1 = mysql_query($insertSQL, $dbTroch) or die(mysql_error());
    ?>
    <!doctype html>
    <html>
    <meta charset="utf-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Troch Project Solutions - Admin - Toevoegen</title>
      <link rel="stylesheet" href="css/foundation.css" />
      <link rel="stylesheet" href="css/layout.css" />
      <!-- Fonts
      ================================================== -->
      <script type="text/javascript" src="//use.typekit.net/vob8gxg.js"></script>
      <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
      <!-- jQuery
      ================================================== -->
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
      <script src="js/vendor/modernizr.js"></script>
    </head>
    <body>
        <div class="row">
          <div class="large-8 medium-8 small-8 large-centered medium-centered small-centered columns intro">
              <h2 class="subheader text-center">Admin</h2>
              <p><a>Log uit</a></p>
              <p><a href="admin.php">Terug naar Admin menu</a>
              <h4>image toevoegen naar aanbod slideshows:</h4>
              <form action="<?php echo $row_rs_aanbod['']; ?>" method="POST" name="add-photos-aanbod" id="add-photos-aanbod" enctype="multipart/form-data">
              <table>
                    <tbody>
                         <tr>
                              <td><label for="image">Kies foto:</label></td>
                              <td><input name="image" type="file" id="image" value="<?php echo $row_rs_aanbod['image']; ?>" /></td>
                        <tr>
                              <td>Sectie:</td>
                              <td><select name="sectie" id="sectie" option value="sectie">
                                <?php
    do { 
    ?>
                                <option value="<?php echo $row_rs_aanbod['sectie']?>"><?php echo $row_rs_aanbod['sectie']?></option>
                                <?php
    } while ($row_rs_aanbod = mysql_fetch_assoc($rs_aanbod));
      $rows = mysql_num_rows($rs_aanbod);
      if($rows > 0) {
          mysql_data_seek($rs_aanbod, 0);
          $row_rs_aanbod = mysql_fetch_assoc($rs_aanbod);
    ?>
                              </select></td> 
                        </tr>
                        <tr>
                            <td><input type="Submit" name="Add" id="add" value="Toevoegen" /></td>
                        </tr>
                </tbody>
            </table>
            <input type="hidden" name="MM_insert" value="add-photos-aanbod" />
        </form>
          </div><!-- end large-8 -->
        </div><!-- end row -->
    <script src="js/vendor/jquery.js"></script>
    <script src="/js/vendor/fastclick.js"></script>
    <script src="js/foundation.min.js"></script>
    <script>
                $(document).foundation();
            </script>
    </body>
    </html>
    <?php
    mysql_free_result($rs_aanbod);
    ?>
    I cannot work out what is wrong and I would appreciate any help on this. Thanks

    Your form field and array variable names do not match
    <td><input name="image" type="file" id="image" value="<?php echo $row_rs_aanbod['image']; ?>" /></td>
    GetSQLValueString($_POST['file'], "text"),

  • Intermittant (not constant) SQL database ShareWebDb login failed events 3760 and 2424

    My Sharepoint 3.0 services that were bundled with SBS 2008 appear to be working fine. Companyweb, etc, all work w/o issue, so I don't want to take violent action, but these errors seem to be accellerating so I would love to know if there is a known
    solution.
    I typically receive the following (these are in reverse time order, latest at the top, just as they appear in the event log):
    Error Event ID: 3760 SQL Database 'ShareWebDb' on SQL Server instance 'np:\\.\pipe\MSSQL$Microsoft##SSEE\sql\query' not found. Additional error information from SQL Server is included below. Cannot open database "ShareWebDb" requested
    by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
    one second earlier:Error Event ID: 2424 The update cannot be started because the content sources cannot be accessed. Fix the errors and try the update again. Context: Application 'Search', Catalog 'index file
    on the search server Search'
    Information Event ID: 18456 No description, here is the Details:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider
    Name="MSSQL$MICROSOFT##SSEE" />
    <EventID Qualifiers="49152">18456</EventID>
    <Level>0</Level>
    <Task>4</Task>
    <Keywords>0x90000000000000</Keywords>
    <TimeCreated
    SystemTime="2010-11-12T18:35:06.000Z" />
    <EventRecordID>491461</EventRecordID>
    <Channel>Application</Channel>
    <Computer>myserver.mydomain.local</Computer>
    <Security
    UserID="S-1-5-20" />
    </System>
    <EventData>
    <Data>NT AUTHORITY\NETWORK SERVICE</Data>
    <Data>[CLIENT: <named pipe>]</Data>
    <Binary>184800000E000000170000005000450054003300310030005C004D004900430052004F0053004F00460054002300230053005300450045000000070000006D00610073007400650072000000</Binary>
    </EventData>
    </Event>
    Two seconds earlier
    Information Event ID 17137 No description, here is the Details:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider
    Name="MSSQL$MICROSOFT##SSEE" />
    <EventID Qualifiers="16384">17137</EventID>
    <Level>4</Level>
    <Task>2</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated
    SystemTime="2010-11-12T18:35:04.000Z" />
    <EventRecordID>491460</EventRecordID>
    <Channel>Application</Channel>
    <Computer>mysever.mydomain.local</Computer>
    <Security
    UserID="S-1-5-20" />
    </System>
    <EventData>
    <Data>ShareWebDb</Data>
    <Binary>F14200000A000000170000005000450054003300310030005C004D004900430052004F0053004F00460054002300230053005300450045000000070000006D00610073007400650072000000</Binary>
    </EventData>
    </Event>
    I get more 3760 errors than 2424's. However, the
    2424's do seem to usually correspond to a 3760 18456 17137 occurance and the
    3760 are always preceeded by 18456 17137. I was getting one or two sets a day, lately that has increased to 5 or 10.
    I've done a lot of
    web research on Sharepoint Errors 3760 and
    2424 and I see a number of people are experiencing the the same issue. Most of what I've come across for solutions do not apply, since errors are intermittent, not chronic and my public remote URL has already been added
    to BackConnectionHostNames as per:
    http://blogs.technet.com/b/sbs/archive/2009/08/05/sharepoint-services-3-search-event-errors-after-an-sbs-2008-update-rollup.aspx
    I installed the SQL Server Management Studio Express so I could try to track down the permissions on this database. I see the SQL server instance, MYSERVER\Microsoft##ssee, and it shows as running, but when I try to connect to it I get the following
    error: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote
    connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)" I'm assuming that is because I don't have access permission for that internal database.
    I don't see any errors in the event log related to failed logins or any errors at all from the SQL server, but there are the time matching informational entries right before the error events and lots of other 17137's and 2803's from MSSQL$Microsoft##ssee

    Thank you Kevin, that does seem to match my symptoms and I have made the change suggested. Just incase that page becomes unreachable by others, here is the part of the page that applies to this:
    Issue:
    =========
    Receive event error 3760 and 6398 on SBS 2008
    Cause:
    ==========
    Issue was caused by incorrect Auto Close option for ShareWebDb database
    Solution:
    ==========
    1. On the SBS 2008 server, click Start -> All Programs -> Microsoft SQL Server 2005, right click SQL Server Management Studio Express and choose run as administrator.
    NOTE: You must run it as administrator to perform steps below.
    2. In the Server Name box, type \\.\pipe\MSSQL$Microsoft##SSEE\sql\query, click connect.
    3. Expand Database node and right click the ShareWebDb then choose properties.
    4. Click Options in the left pane, in the right pane, please check whether the Auto Close option is set to True, if so, please change it to False.

  • I am trying to install Dreamweaver CS3 on Windows 8 it says "The Installer Database is corrupt"

    I am trying to install Dreamweaver CS3 on my new Windows 8 PC and when I run SETUP.EXE it says "The Installer Database is corrupt" on both my original CD and backup I made.

    The error is here:
    Dreamweaver CS3 on my new Windows 8 PC
    This will most likely never work. CS3 wasn't even fit for Win 7. Delete the caps.db in the respective caps folder (info here) and then take the usual steps of running as admin, turning off UAC and security tools and possibly using compatibility modes, but as I said, be prepared that this may be futile and you spend a Sunday afternoon without achieving anything...
    Mylenium

  • I need to host a website with a SQL database - Azure pricing details are too confusing

    Hello,
    I need to give a potential client a hosting price for a somewhat simple web application they want me to build. I told them it shouldn't be a problem. After gathering the requirements, I figured I would use the following technology to build and host
    it:
    ASP.NET 4.5
    MVC 5
    1 SQL Database ~ 25GB with options to expand and also with a backup
    SSL certificate needed
    Hosting would be on Azure because I have some experience using Visual Studio 2012 and integrating the Visual Studio Online (TFS) source code and scrum web applications. I've never actually spun up a website with a SQL database using Azure before, but I
    imagined it wasn't too difficult to find a general hosting plan to support the above requirements.
    The use of the website will be very simple and limited to the basic CRUD operations. Will support forms authentication using the Identity 2.0 framework. The web applications main purpose is to fill out a form for new accounts, have a search page for
    those accounts, a page to view a created account and add notes to it. So performance wise, it isn't asking for much. I just want it to be fast and secure.
    So I start looking on the Azure's pricing landing page which is here: (can't put links in here, but search Azure pricing on Bing) and I see this Pricing Calculator, so I click it
    First thing I notice is the Websites tab doesn't mention SQL Database - in fact the Data Management is a separate tab from Websites. And if I made my selections on the Websites tab, the estimated monthly price doesn't stay the same when I go to the Data
    Management tab - so I get the illusion I have to have two separate purchases.
    I'm not exactly sure if the Pay as You Go billing feature would be okay because it's just a bit scary to leave every monthly payment up to chance; somewhat. Would love to know if there is other payment options that I could see for what I described above.
    I want to use Azure to host my asp.net website - it makes sense and the integration with Visual Studio is amazing. I love the publish feature for both MVC 5 Projects and SQL Database Projects.
    Thanks in advance for the help!

    Hello jdevanderson,
    I suggest that you start by looking at the pricing TIERS for the Azure website. This link will give you clarity on different Service TIERS that are availaible:
    http://azure.microsoft.com/en-in/pricing/details/websites/
    You can guage your requirement and choose the Service TIER accordingly.
    And regarding the database, you are right about it. You will be charged seperately for the database. You can refer to this link that will give you clarity on SQL database pricing:
    http://azure.microsoft.com/en-in/pricing/details/sql-database/
    Refer to this link for more information on 'How pricing works':
    http://azure.microsoft.com/en-in/pricing/
    Use the full calculator to add your website and the database to get an estimated cost:
    http://azure.microsoft.com/en-in/pricing/calculator/?scenario=full
    Thanks,
    Syed Irfan Hussain

  • Advise on SQL database process

    Dear all,
    We have build our own product CMS platform configuration which is running on SQL server and CMS web site link to it.
    We will lauch our product soon but need to identify the correct hosting plan for not having any further issue.
    For exemple for now all is hosted in our company azure account with a Standard Basic 5 DTU's.
    When we go in production we can expect some connection and big amount of data on our database.
    My question are as follow :
    - Does using a single database storage for my potential Customers would be enough ?
    - How should I plan backup efficiently ?
    - Should I plan a safety replication process somewhere in azure or duplicate the storage in order to switch in case of lack of place ?
    My concern is to avoid my database beeing full while customers increase
    Thanks for your advise and help
    regards
    serge

    Hi Solatys,
    - If I select by default STANDARD Azure database, which size, DTU, etc should I select ? 
    For this question, you may reference the below link. You can scale your Azure database performance based on the real-time requirement.
    Azure
    SQL Database introduces new near real-time performance metrics 
    - If for instance the initial URL of the web portal connected to SQL server1 has a trouble, how can I switch users transparently to a second replicated server in order that user will notify anything ?
    Azure SQL Database has a built-in high availability subsystem that protects your database from failures of individual servers and devices in a datacenter. Azure SQL
    Database maintains multiple copies of all data in different physical nodes located across fully independent physical sub-systems to mitigate outages due to failures of individual server components, such as hard drives, network interface adapters, or even entire
    servers. At any one time, three database replicas are running—one primary replica and two or more
    secondary replicas. Data is written to the primary and one secondary replica using a quorum based commit scheme before the transaction is considered committed.
    If the hardware fails on the primary replica, Azure SQL Database detects the failure and fails over to the secondary replica. In case of a physical loss of a replica, a new replica is automatically created.
    So there are always at minimum two physical, transactionally consistent copies of your data in the datacenter.
    Azure SQL Database Business Continuity
    - IF I select the Maximum size of the database, what will happen in case it will be nearly full and need to provide more space ?
    Insert and update transactions that exceed the upper limit will be rejected because the database will be in read-only mode. The maximum size has been gained from 50GB to 500GB as of now, you may have no concern about it. You can
    set a monitoring alertto
    notify the storage utilization and CPU percentage etc.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Merge to Insert or update records in SQL Database

    Hello ,
    I am having hard time with creating a Stored Procedure to insert/update the selected records from Oracle data base to SQL database using BizTalk.
    ALTER PROCEDURE [dbo].[uspInsertorUpdateINF]
    @dp_id char(32),
    @dv_id char(32),
    @em_number char(12),
    @email varchar(50),
    @emergency_relation char(32),
    @option1 char(16),
    @status char(20),
    @em_id char(35),
    @em_title varchar(64),
    @date_hired datetime
    AS
    BEGIN
    SET NOCOUNT ON;
    MERGE [dbo].[em] AS [Targ]
    USING (VALUES (@dp_id, @dv_id , @em_number, @email, @emergency_relation, @option1, @status, @em_id, @em_title, @date_hired))
    AS [Sourc] (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title, date_hired)
    ON [Targ].em_id = [Sourc].em_id
    WHEN MATCHED THEN
    UPDATE SET dp_id = [Sourc].dp_id,
    dv_id = [Sourc].dv_id,
    em_number = [Sourc].em_number,
    email = [Sourc].email,
    emergency_relation = [Sourc].emergency_relation,
    option1 = [Sourc].option1,
    status = [Sourc].status,
    em_title = [Sourc].em_title,
    date_hired = [Sourc].date_hired
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title,date_hired)
    VALUES ([Sourc].dp_id, [Sourc].dv_id, [Sourc].em_number, [Sourc].email, [Sourc].emergency_relation, [Sourc].option1, [Sourc].status, [Sourc].em_id, [Sourc].em_title, [Sourc].date_hired);
    END;
    I am getting an error like
    WcfSendPort_SqlAdapterBinding_
    TypedProcedures_dbo_Custom" with URL "mssql://abc//def?". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'uspInsertorUpdateINF'
    expects parameter '@dp_id', which was not supplied
    I cannot give the Oracle Database name directly in the stored Procedure
    I am stuck with this, and cannot figure out since I am new to SQL Queries and Stored Procedures. Any help is greatly appreciated.
    Thanks

    Hi sid_siv,
    Only the first record is inserted because of the scalar variables of the stored procedure(SP), when you call the SP, only one row is passed. To get all rows inserted, you can either declare a
    table-valued parameter
    (TVP) for the SP or using an Oracle linked server in the SP.
    Create a stored procedure with a table-valued parameter
    As you mentioned linked server is not good in your case, then TVP SP can be the only option. Regarding how to call a SP with TVP parameter in BizTalk, that's a typically BizTalk question then. I would suggest you post your question in a dedicated
    BizTalk Server forum. It is more appropriate and more experts will assist you.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Check for duplicate record in SQL database before doing INSERT

    Hey guys,
           This is part powershell app doing a SQL insert. BUt my question really relates to the SQL insert. I need to do a check of the database PRIOR to doing the insert to check for duplicate records and if it exists then that record needs
    to be overwritten. I'm not sure how to accomplish this task. My back end is a SQL 2000 Server. I'm piping the data into my insert statement from a powershell FileSystemWatcher app. In my scenario here if the file dumped into a directory starts with I it gets
    written to a SQL database otherwise it gets written to an Access Table. I know silly, but thats the environment im in. haha.
    Any help is appreciated.
    Thanks in Advance
    Rich T.
    #### DEFINE WATCH FOLDERS AND DEFAULT FILE EXTENSION TO WATCH FOR ####
                $cofa_folder = '\\cpsfs001\Data_pvs\TestCofA'
                $bulk_folder = '\\cpsfs001\PVS\Subsidiary\Nolwood\McWood\POD'
                $filter = '*.tif'
                $cofa = New-Object IO.FileSystemWatcher $cofa_folder, $filter -Property @{ IncludeSubdirectories = $false; EnableRaisingEvents= $true; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' }
                $bulk = New-Object IO.FileSystemWatcher $bulk_folder, $filter -Property @{ IncludeSubdirectories = $false; EnableRaisingEvents= $true; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' }
    #### CERTIFICATE OF ANALYSIS AND PACKAGE SHIPPER PROCESSING ####
                Register-ObjectEvent $cofa Created -SourceIdentifier COFA/PACKAGE -Action {
           $name = $Event.SourceEventArgs.Name
           $changeType = $Event.SourceEventArgs.ChangeType
           $timeStamp = $Event.TimeGenerated
    #### CERTIFICATE OF ANALYSIS PROCESS BEGINS ####
                $test=$name.StartsWith("I")
         if ($test -eq $true) {
                $pos = $name.IndexOf(".")
           $left=$name.substring(0,$pos)
           $pos = $left.IndexOf("L")
           $tempItem=$left.substring(0,$pos)
           $lot = $left.Substring($pos + 1)
           $item=$tempItem.Substring(1)
                Write-Host "in_item_key $item in_lot_key $lot imgfilename $name in_cofa_crtdt $timestamp"  -fore green
                Out-File -FilePath c:\OutputLogs\CofA.csv -Append -InputObject "in_item_key $item in_lot_key $lot imgfilename $name in_cofa_crtdt $timestamp"
                start-sleep -s 5
                $conn = New-Object System.Data.SqlClient.SqlConnection("Data Source=PVSNTDB33; Initial Catalog=adagecopy_daily; Integrated Security=TRUE")
                $conn.Open()
                $insert_stmt = "INSERT INTO in_cofa_pvs (in_item_key, in_lot_key, imgfileName, in_cofa_crtdt) VALUES ('$item','$lot','$name','$timestamp')"
                $cmd = $conn.CreateCommand()
                $cmd.CommandText = $insert_stmt
                $cmd.ExecuteNonQuery()
                $conn.Close()
    #### PACKAGE SHIPPER PROCESS BEGINS ####
              elseif ($test -eq $false) {
                $pos = $name.IndexOf(".")
           $left=$name.substring(0,$pos)
           $pos = $left.IndexOf("O")
           $tempItem=$left.substring(0,$pos)
           $order = $left.Substring($pos + 1)
           $shipid=$tempItem.Substring(1)
                Write-Host "so_hdr_key $order so_ship_key $shipid imgfilename $name in_cofa_crtdt $timestamp"  -fore green
                Out-File -FilePath c:\OutputLogs\PackageShipper.csv -Append -InputObject "so_hdr_key $order so_ship_key $shipid imgfilename $name in_cofa_crtdt $timestamp"
    Rich Thompson

    Hi
    Since SQL Server 2000 has been out of support, I recommend you to upgrade the SQL Server 2000 to a higher version, such as SQL Server 2005 or SQL Server 2008.
    According to your description, you can try the following methods to check duplicate record in SQL Server.
    1. You can use
    RAISERROR to check the duplicate record, if exists then RAISERROR unless insert accordingly, code block is given below:
    IF EXISTS (SELECT 1 FROM TableName AS t
    WHERE t.Column1 = @ Column1
    AND t.Column2 = @ Column2)
    BEGIN
    RAISERROR(‘Duplicate records’,18,1)
    END
    ELSE
    BEGIN
    INSERT INTO TableName (Column1, Column2, Column3)
    SELECT @ Column1, @ Column2, @ Column3
    END
    2. Also you can create UNIQUE INDEX or UNIQUE CONSTRAINT on the column of a table, when you try to INSERT a value that conflicts with the INDEX/CONSTRAINT, an exception will be thrown. 
    Add the unique index:
    CREATE UNIQUE INDEX Unique_Index_name ON TableName(ColumnName)
    Add the unique constraint:
    ALTER TABLE TableName
    ADD CONSTRAINT Unique_Contraint_Name
    UNIQUE (ColumnName)
    Thanks
    Lydia Zhang

  • Error upon inserting data in sql Database using stream analytics job: Datatye error conversion

    I have a data passed into the Event Hubs, queried by stream analytic job inserting it into sql database. Upon running the job, it becomes idle a few seconds after since it has an error:
    Message: Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64.
    Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64. Exception message at level [1], exception number [0], parent exception number [0]: Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64.
    The data type in one of my field(IsHistorical) is Boolean with a value of false. The data type of the column in the sql table where this is to be inserted is of type bit. In this case, it seems that stream analytics could not convert the value "false"
    into a bit data type when inserting in sql table.
    I'm wondering if you already have encountered this problem. Could you help me resolve this problem?
    Thank you.

    Azure Stream Analytics does not have Boolean type. On input we will convert JSON Boolean value to bigint.
    Here is the list of supported types and conversions:
    https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx 
    You  can fix this erro by changing column type from bit to int in SQL table schema.

  • UUT Result log in SQL database?

    Hello All
    I am facing a requirement where i want to log results of sequence execution[only the complete seq result and NOT step results] to SQL database BUT as and when the UUT_ID varies the entry should be made into a new column with the same name as UUT_ID. As of now whenever i execute a sequence with different UUT_ID, a new row gets added as a result.
    Please reply back with your suggestions asap, as this very urgent for me :-)
    Regards
    Nitin Goel

    But in my opinion, that's just a way to display the results - not a way to store the data. I also have thousands of test cases and tens of thousands of different UUT each month. Each UUT has a separate record (a unique row) and yet if I design a proper query and report format, I can show the results exactly like you have. The design of a relational database should not be the same as a report design, imho.
    A database is designed to have unlimited rows (dependent only on storage space). I'm not sure a db can have unlimited columns. That would be something you could check with your dba. Dynamically adding a new column and doing an update to an existing row would probaby be much slower than just doing an insert.

Maybe you are looking for

  • ASA5505 Upgrade to 9.1.5 from 8.4.1 - problem with nat and accessing external host

    When running on 8.4 i had a working config with the following scenario. I have 2 interfaces configured as the outside interface. One is connected to my internet connection The other one is connected to a host that has a public ip. The public host can

  • Need Help in configuring Antivirus on content services

    Hi All, We are using Content Services 10.1.2.3.4 and for antivirus we are using Symnatec Antivirus Scan Engine(SAVSE) 5.1. We have installed Antivirus on both the boxes separately and while configuring the domain properties we are facing problem--> w

  • Clip viewer window too big

    When I press "open clip" it opens the clip in a window that's bigger than my screen, which is a problem since I can't see the key at the bottom. Whenever this has happened with other software, I would just press the green maximize button and it would

  • Export to disk vs. Send to iTunes

    What is the difference between these two options? Basically, I want to edit my GarageBand project with Pro Tools, but I want the mixdown to be uncompressed so there's no audio quality loss. Thanks. MacBook (2 GHz Intel Core 2 Duo, 2 GB 677 MHz)   Mac

  • Using Berkeley Java Edition with Java Web Start

    Hi Have anyone had any experience using Berkeley Java Edition with Java Web Start?. I need to create an application that will download with the database to a client computer and create the database there