How to repair database using SQL server 2008 and C#

How to repair database in SQL server 2008 using C#
Musakkhir Sayyed.

Unfortunately your post is off topic as it's not specific to SQL Server Samples and Community Projects.  
This is a standard response I’ve written in advance to help the many people who post their question in this forum in error, but please don’t ignore it.  The links I provide below will help you determine the right forum to ask your
question in.
For technical issues with Microsoft products that you would run into as an end user, please visit the Microsoft Answers forum ( http://answers.microsoft.com ) which has sections for Windows, Hotmail,
Office, IE, and other products.
For Technical issues with Microsoft products that you might have as an IT professional (like technical installation issues, or other IT issues), please head to the TechNet Discussion forums at http://social.technet.microsoft.com/forums/en-us, and
search for your product name.
For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), please head to the MSDN discussion forums at http://social.msdn.microsoft.com/forums/en-us, and
search for your product or issue.
If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here: http://community.dynamics.com/
If you think your issue is related to SQL Server Samples and Community Projects and I've flagged it as Off-topic, I apologise.  Please repost your question and include as much detail as possible about your problem so that someone can assist you further. 
If you really have no idea where to post your question please visit the Where is the forum for…? forum http://social.msdn.microsoft.com/forums/en-us/whatforum/
When you see answers and helpful posts, please click Vote As Helpful,
Propose As Answer, and/or Mark As Answer
Jeff Wharton
MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCSD, MCSA, MCITP, MCDBA
Blog: Mr. Wharty's Ramblings
Twitter: @Mr_Wharty
MC ID:
Microsoft Transcript

Similar Messages

  • How to connect captivate file in a database (MS SQL SERVER 2008)

    Hi...
    How to connect captivate file in a database (MS SQL SERVER 2008) ???
    Kindly response please..
    thanks!!!

    Hi there
    See if the link below helps you out.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Permission denied when creating database in Sql Server 2008 for SQLExpress

    I'm getting an permission error while restoring the database. I'm using SQL Server 2008 SQLEXPRESS
    I'm able to create the user using this script " CREATE LOGIN [darth\vader] FROM WINDOWS;
    GO;"
    But when I try to give role to the user it's still give me permission error.. SP_ADDSRVROLEMEMBER ‘darth\vader’, ‘sysadmin’
    Can someone guide me how to resolve this issue?

    http://msdn.microsoft.com/en-us/library/ms186858.aspx
    Permissions
    If the database being restored does not exist, the user must have CREATE DATABASE permissions to be able to execute RESTORE. If the database exists, RESTORE permissions default to members of the sysadmin and dbcreator fixed
    server roles and the owner (dbo) of the database (for the FROM DATABASE_SNAPSHOT option, the database always exists).
    RESTORE permissions are given to roles in which membership information is always readily available to the server. Because fixed database role membership can be checked only when the database is accessible and undamaged, which is not always the case when RESTORE
    is executed, members of the db_ownerfixed database role do not have RESTORE permissions.
    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

  • Another Error in Initializing Database in SQL Server 2008 R2

    Hi All,
    I'm facing very strange problem with my current LiveCecle ES 2.5 deployed in the Windows Server 2008 in which i must use Websphere 6.1 as the Application server and then then Databse must be using SQL Server 2008 R2.
    see the following error message:
    If anyone here has ever done the installation on Websphere and SQL Server 2008R2 please share it here.
    Thanks.

    Sean 
    Congrats on the new job in MSFT or am I missing something? :-)
    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

  • Improve the performance in stored procedure using sql server 2008 - esp where clause in very big table - Urgent

    Hi,
    I am looking for inputs in tuning stored procedure using sql server 2008. l am new to performance tuning in sql,plsql and oracle. currently facing issue in stored procedure - need to increase the performance by code optmization/filtering the records using where clause in larger table., the requirement is Stored procedure generate Audit Report which is accessed by approx. 10 Admin Users typically 2-3 times a day by each Admin users.
    It has got CTE ( common table expression ) which is referred 2  time within SP. This CTE is very big and fetches records from several tables without where clause. This causes several records to be fetched from DB and then needed processing. This stored procedure is running in pre prod server which has 6gb of memory and built on virtual server and the same proc ran good in prod server which has 64gb of ram with physical server (40sec). and the execution time in pre prod is 1min 9seconds which needs to be reduced upto 10secs or so will be the solution. and also the exec time differs from time to time. sometimes it is 50sec and sometimes 1min 9seconds..
    Pl provide what is the best option/practise to use where clause to filter the records and tool to be used to tune the procedure like execution plan, sql profiler?? I am using toad for sqlserver 5.7. Here I see execution plan tab available while running the SP. but when i run it throws an error. Pl help and provide inputs.
    Thanks,
    Viji

    You've asked a SQL Server question in an Oracle forum.  I'm expecting that this will get locked momentarily when a moderator drops by.
    Microsoft has its own forums for SQL Server, you'll have more luck over there.  When you do go there, however, you'll almost certainly get more help if you can pare down the problem (or at least better explain what your code is doing).  Very few people want to read hundreds of lines of code, guess what's it's supposed to do, guess what is slow, and then guess at how to improve things.  Posting query plans, the results of profiling, cutting out any code that is unnecessary to the performance problem, etc. will get you much better answers.
    Justin

  • How to secure connection in sql server 2008? my main problem is which certificate should i add in mmc

    i'm recently working on hardening of sql server 2008. now i face with a problem. my problem is  how to secure connection in sql server 2008?  my main problem is which certificate should i add in mmc? what are these certificates about?and guide
    me in choosing the appropriate certificate.
    and how should i know that the connection in sql server is secured?
    plz guide me from the beginning cause i'm rookie in this subject.
    thanks in advance.

    Hi sqlfan,
    Question 1: my problem is how to secure connection in sql server 2008?
    Microsoft SQL Server can use Secure Sockets Layer (SSL) to encrypt data that is transmitted across a network between an instance of SQL Server and a client application. For more information about Encrypting Connections to SQL Server, please refer to the following
    article:
    http://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx
    Question 2: my main problem is which certificate should i add in mmc? what are these certificates about?and guide me in choosing the appropriate certificate.
    To install a certificate in the Windows certificate store of the server computer, you will need to purchase/provision a certificate from a certificate authority first. So please go to a certificate authority to choose the appropriate certificate.
    For SQL Server to load a SSL certificate, the certificate must meet the following conditions:
    The certificate must be in either the local computer certificate store or the current user certificate store.
    The current system time must be after the Valid from property of the certificate and before the Valid to property of the certificate.
    The certificate must be meant for server authentication. This requires the Enhanced Key Usage property of the certificate to specify Server Authentication (1.3.6.1.5.5.7.3.1).
    The certificate must be created by using the KeySpec option of AT_KEYEXCHANGE. Usually, the certificate's key usage property (KEY_USAGE) will also include key encipherment (CERT_KEY_ENCIPHERMENT_KEY_USAGE).
    The Subject property of the certificate must indicate that the common name (CN) is the same as the host name or fully qualified domain name (FQDN) of the server computer. If SQL Server is running on a failover cluster, the common name must match the host
    name or FQDN of the virtual server and the certificates must be provisioned on all nodes in the failover cluster.
    Question 3: how should i know that the connection in sql server is secured?
    If the certificate is configured to be used, and the value of the ForceEncryption option is set to Yes, all data transmitted across a network between SQL Server and the client application will be encrypted using the certificate. For more detail about this,
    please refer to Configuring SSL for SQL Server in the following article:
    http://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx
    If you have any question, please feel free to let me know.
    Regards,
    Donghui Li

  • Difference between database features - SQL Server 2008 R2 navtive vs SQL Server 2012 with SQL Server 2008 compatibility set?

    I am investigating the impact of upgrading from SQL Server 2008 R2 to SQL Server 2012. To reduce the impact of the upgrade, I am planning to restore / create our application database onto SQL Server 2012 with compatibility level 100 (SQL Server 2008 and
    SQL Server 2008 R2).
    Are there any differences in feature support for database running in native mode on SQL Server 2008 R2 vs a database installed on SQL Server 2012 with compatibility level 100 set?

    Are there any differences in feature support for database running in native mode on SQL Server 2008 R2 vs a database installed on SQL Server 2012 with compatibility level 100 set?
    Yes there can be difference and impact there are few features deprecated in SQL Server 2012 you must be aware about that. Please see
    Deprecated Database Features in SQL Server 2012
    Deprecated SQL Server features in SQL Server 2012
    After you migrate database to 2012 please don't move ahead with production unless you have tested your application to new created database
    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
    My Technet Wiki Article
    MVP

  • Sql server 2008 and Windows 8

    Hi
    I published my WPF application using VS 2010 Express edition and trying to install it on Windows 8.  The application runs but when it comes to searching the database that was included in the installation package it gives the error
    "This program has compatibility issues Microsoft SQL Server(2008 and 2008 R2)"
    The installer when setup was run did download SQL Server so I am not sure why I am getting this error.  Any advice?

    Hello,
    Service Pack 3 for SQL Server 2008 is required to make it compatible for Windows 8 or Windows 8.1. For more information,
    please read the following Support article:
    https://support.microsoft.com/kb/2681562?wa=wsignin1.0
    You can download SP3 from the following URL:
    http://www.microsoft.com/en-us/download/details.aspx?id=27594
    If you are installing SQL Server 2008, continue setup despite of the warning and apply SP3 after installing SQL Server 2008.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How to send PLAIN text email from sp_send_dbmail using SQL Server 2008 R2?

    I have configured Database Mail in SQL Server 2008 R2 (64) and it sends emails just fine. However the destination is recieving the body of thes message as Base 64 encoding.
    Snippet:
    EXEC msdb..sp_send_dbmail @profile_name='Outmail', @recipients = @recpts, @subject = @subj, @body_format = 'TEXT', @body=@body2;
    As you can see I set @body_format to TEXT, but it still sends Base 64. I need to send plain ASCII text. How can I change this?

    I am having this exact issue too.  I have a trigger that sends an email using a stored procedure.  The dbmail is sending the email using the Exchange 2010 server SMTP.  It does not login so the email is relayed as user = "Anonymous". 
    The SQL dbmail email header is showing the following:
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: base64
    MIME-Version: 1.0
    X-MS-Exchange-Organization-AuthSource: MX01.domain.local
    X-MS-Exchange-Organization-AuthAs: Anonymous
    Here is the header if I send via Outlook profile using the legacy program I am trying to automate using SQL Server 2008R2:
    Content-Type: application/ms-tnef; name="winmail.dat"
    Content-Transfer-Encoding: binary
    MIME-Version: 1.0
    X-MS-Has-Attach:
    X-MS-Exchange-Organization-SCL: -1
    X-MS-TNEF-Correlator: <[email protected]>
    MIME-Version: 1.0
    X-MS-Exchange-Organization-AuthSource: MX01.domain.local
    X-MS-Exchange-Organization-AuthAs: Internal
    X-MS-Exchange-Organization-AuthMechanism: 03
    X-Originating-IP: [192.168.13.66]
    Any help would be greatly appreciated!

  • From SharePoint Content Database, Using SQL-Server Query how to fetch the 'Document GUID' based on 'Content Type'

    I want to get all the documents based on content type using SQL Server Query. I know that, querying the content database without using API is not advisable, but still i want to perform this action through SQL Server Query. Can someone assist ?

    You're right, it's not advisable, may result in corruption of your databases and might impact performance and stability. But assuming you're happy to do that then it is possible.
    Before you go down that route, have you considered using something more safe like PowerShell? I've seen a script exactly like the one you describe and it would take far less time to do it through PS than it would through SQL.

  • How  to access database in Sql Server 7.0 using Java

    I am trying to access a database in SQL Server 7.0 using JDBC.But it is giving me errors.I have used following statements to connect the database
    private String URL = "jdbc:odbc:DatabaseName";
    private String userName="user";
    private String passWord="password";
    Class.forName( "sun.jdbc.odbc.SQLServerDriver" );
    connection = DriverManager.getConnection( URL,userName,"passWord" );
    where "username" and "password" are user Name and password respectively to access the database in SQL Server 7.0.

    I am sorry but I have written like;
    private String URL = "jdbc:odbc:DatabaseName";
    private String userName="user";
    private String passWord="password";
    Class.forName( "sun.jdbc.odbc.jdbcOdbcDriver" );
    connection = DriverManager.getConnection( URL,userName,"passWord" );
    where "username" and "password" are user Name and password respectively to access the database in SQL Server 7.0. And I have used the same name in "ODBC data source" as that of the database.I am trying some examples from book and these examples just work fine with MS Access( I created those databases in Access and tried the examples) but not with SQL Server 7.0. Do I need a separate driver or something?

  • Moving an existing SQL Express Database to SQL Server 2008 (included in SBS2011) help!

    I have software that uses SQL 2005 right now, but the database is close the max size (4 GB). I have SBS2011 installed and it includes SQL 2008 and SQL 2008R2.  I want to move the database to the 2008 version that can that can handle larger databases.
    I'm not an SQL expert, but have some experience with it.  What I need are some directions on how to make this change without causing any problems with the system, including setting up the SQL server so it will have all the same settings as the old one.
    This is a practice management software.
    Thanks in advance for any help.  Harvey

    Hi,
    I think you can upgrade SQL Server 2005 to later version of SQL Server rather than moving the existing database to another SQL Server instance.
    Upgrade SQL Server 2005 SP2 Express to SQL Server 2008 R2 Express and SQL Server 2005 SP4 SQL Server 2012 Express. And you will have maximum 10 GB per database.
    Make sure that your operation system is compatible with SQL Server
     version which you want to upgrade to. For more information, see:
    http://msdn.microsoft.com/en-us/library/ms143506(v=sql.105).aspx#SSE_x64
    It is possible to backup and restore the database on another instance and modify the database path in the software.
    You need to test it in your test environment first before making changes in the production environment.
    In addition, you need to consult with the software developer and see if there is any potential issue.
    Upgrade to SQL Server 2012 Using the Installation Wizard (Setup)
    http://technet.microsoft.com/en-us/library/ms144267.aspx
    Back Up and Restore of SQL Server Databases
    http://technet.microsoft.com/en-us/library/ms187048.aspx
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Creating dynamic database connection (SQL server 2008) from Adf application

    Hello,
    I am creating an ADF Fusion Application. I use Jdev. 11.1.2.3.0 , WebLogic 10.3 and MS SQL server 2008 database. My question is that how can I create a database connection configuration file, now I connect to the database through hard coding, there should be a way to do this with sql server I think.
    my database name is : testDatabase
    my database username is : testUser
    my database password is : testPassword
    Anybody can help me please.
    Thanks,
    Shahe

    Hello Frank,
    The database schema is the same for all the users, but the location of the database differs, for example: I have set the hostname of the database to localhost because the database is installed on the local pc, but to other clients the database is installed on a managed server so in the hostname I should put the server's ip address or name. So I need an external file where I can set these options.
    Thanks,
    Shahe

  • Error during database connection to the database : MS SQL Server 2008 R2

    Hi All,
    I am working with ABAP Proxy to Rec JDBC( Integrating XI with MS SQL Server 2008 R2). I am using SAP PI 7.0
    I am getting error in RWB at communication channel monitoring :
    Error during database connection to the database URL 'jdbc:microsoft:sqlserver://10.1.92.111:1433;database=XONTUSERVENTURA_ORG_TEST' using the JDBC driver 'com.microsoft.jdbc.sqlserver.SQLServerDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:microsoft:sqlserver://10.1.92.111:1433;database=XONTUSERVENTURA_ORG_TEST': SAPClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver'
    I have given Connection details at Rec JDBC Communication channel as :
    JDBC Driver as : com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection : jdbc:sqlserver://10.1.92.111:1433;database=XONTUSERVENTURA_ORG_TEST.
    Please help me in this regard. I really appreciate your valuable information and time.
    Thanks and Regards,
    Ayub.
    Edited by: Ayubsajjid on Feb 15, 2012 8:49 AM

    Hi All,
    Thanks for all your valuable inputs on my question...
    As per all your inputs, we have to install/Deploy the below required jar files in the aii_af_jmsproviderlib.sda file
    ojdbc14.jar
    msbase.jar
    mssqlserver.jar
    msutil.jar
    Can you please tell me from where we will exact this .jar file, bcoz we have search lotzz but we helpless.
    We install from this link http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21599--> we download sqljdbc_3.0.1301.101_enu  file >sqljdbc_3.0>enu-->in that I find sqljdbc.jar and sqljdbc4.jar files only . I cant above said .jar files.
    Please help me.
    Regards,
    Ayub.

  • Problem with restore database in sql server 2008

    hi,,,when i want to restore database from a .bak file i see this error
    TITLE: Microsoft SQL Server Management Studio
    Restore failed for Server 'ALI-PC'.  (Microsoft.SqlServer.SmoExtended)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
    ADDITIONAL INFORMATION:
    System.Data.SqlClient.SqlError: The database was backed up on a server running version 10.50.4000. That version is incompatible with this server, which is running version 10.00.1600. Either restore the database on a server that supports the backup, or use a
    backup that is compatible with this server. (Microsoft.SqlServer.Smo)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&LinkId=20476
    BUTTONS:
    OK
    i checked overwrite the existing database(WUTH REPLACE) in option,but i cant restore again,,,please help me

    Hi,
    You need to install SQL Server 2008 R2 Service Pack 2
    Download
    http://www.microsoft.com/en-us/download/details.aspx?id=11093, you are currently running the RTM and the backup was from Version 10.50.4000 and your attempting to restore to version 10.00.1600.
    To find your current SQL Version open a New Query and paste the following then execute
    SELECT @@VERSION AS 'SQL Server Version
    Reference:
    http://sqlserverbuilds.blogspot.com/
    http://support.microsoft.com/kb/321185
    http://technet.microsoft.com/en-us/library/ms177512.aspx
    Cheers,
    -Ivan

Maybe you are looking for

  • Cleared/Open Item Symbol not Green for Cleared Items

    F.13 process for clearing GR/IR matched items runs to tag documents as cleared. For some reason the Cleared/Open Item Indicator is still showing the status as "Red" for the items which are actually cleared, means the items are shown as "Open" while s

  • Administration Node and non-default certificate

    Hello, We are running our administration server on one host, and we have multiple other hosts configured as administration nodes. We used our company CA to generate a server certificate for our administration server, and that appears to be working fi

  • CS 5.5 Photoshop 12.1 and touch capabilities of new notebook.

    Hello Everybody, It.s Diego. Some years ago I bought creative suite production edu 5.5. I'd like to know if Photoshop of CS 5.5 works with touch capabilities like graphic pen pad with products like this: http://www.dell.com/us/business/p/precision-m3

  • Can anyone suggest an 802.11g card for my PowerBook G4

    Just bought an Airport Extreme card only to find it's not compatible with my PowerBook G4, 867mhz which is the old Airport Card compatible which is older 802.11b technology selling for around $150 bucks on ebay. I'd love to find something that plugs

  • How to handle two operations on same infotype in SAP_PA backend service?

    I have a requirement where I need to design the process either create or change the record of a child in infotype 0021. The SAP_PA does not allow multiple operations on same infotype. It would be great if someone can give me an idea as to how this sc