Nested CASE expressions in SQL Server 2008 R2

Hi, For some reason when I use the below CASE expression in my SELECT statement I get duplicate records.
CASE WHEN <Condition 1> THEN <Expression 1>
WHEN <Condition 2> THEN <Expression 2>
WHEN <Condition 3> THEN <Expression 3>
WHEN <Condition 4> THEN <Expression 4>
END AS CaseResult
Also tried using coalesce with no luck. How to write a nested CASE expression which would yield just one expression. In case if I have to combine 2 different Expressions for 1 record, Is there a way to merge the 2 Expressions writing CASE
expression something like below.
STUFF ((SELECT ',' + CASE WHEN <Condition 1> THEN <Expression 1>
WHEN <Condition 2> THEN <Expression 2>
WHEN <Condition 3> THEN <Expression 3>
WHEN <Condition 4> THEN <Expression 4>
END
FOR XML PATH(''), ROOT('MyString'), TYPE).value('/MyString[1]','VARCHAR(MAX)'), 1, 1,'') AS CaseResult
--ResultSet
CaseResult
<Expression 1, Expression 2>
I am using SQL Server 2008 R2. Thanks in advance.......
Ione

Hi, For some reason when I use the below CASE expression in my SELECT statement I get duplicate records. Also tried using coalesce with no luck. How to write a nested CASE expression which would yeild just one expression. In case if I have to combine 2 different
Expressions for 1 record, Is there a way to merge the 2 Expressions writing CASE expression something like below in SQL Server 2008 R2.
CASE WHEN <Condition 1> THEN <Expression 1>
WHEN <Condition 2> THEN <Expression 2>
WHEN <Condition 3> THEN <Expression 3>
WHEN <Condition 4> THEN <Expression 4>
END AS CaseResultSTUFF ((SELECT ',' + CASE WHEN <Condition 1> THEN <Expression 1>
WHEN <Condition 2> THEN <Expression 2>
WHEN <Condition 3> THEN <Expression 3>
WHEN <Condition 4> THEN <Expression 4>
END
FOR XML PATH(''), ROOT('MyString'), TYPE).value('/MyString[1]'<span clas
Ione

Similar Messages

  • Migrate P6 Pro Rel7 DB from Oracle 10g Express to SQL server 2008

    Please advise the steps needed to migrate my P6 Professional Rel7 (laptop) Oracle 10g Express to P6 Enterprise Rel7 (server) migrating over to SQL server 2008.
    I don't want to lose any of my activity codes during the migration.
    Thanks in advance for any comments or guidance.
    CH

    You can use migrate.bat (Media folder/database/installation). Enter the details of the source (oracle db) to destiny (SQL) . The app will migrate everything, the projects, activities, uds, users, filters, layouts, etc.. .
    Regards,
    Pablo

  • SQL Server 2008 R2 Express with SP2: 'SQLEXPRESS'-instance installation fails while any other instance name installation succeeds.

    We supply our software package that also includes the unattended installation (with /QS and so on) of SQL Server R2 Express (with SP2).
    The setup works good in about 99.9% cases, but one customer complained that after the "successful SQL Sever installation (at least, it looked so!) he could not open the supplied database getting some strange error messages...
    After some months of trial-n-error attempts we are now able to reproduce the problems this custumer had. But we cannot find the reason of the problem.
    So the test computer is a virtual machine with Windows 7 + sp1 32-bit.
    Among the programs/tools installed on this machine there were (in the following order):
    SQL Server 2008 Express - the default SQLEXPRESS instance
    SSMS
    VS 2010 Pro (German)
    SQL Server 2008 Express R2 (with SP 1 or SP2 - ?) - the default SQLEXPRESS instance
    Then some of them were uninstalled in the following order:
    SQL Server 2008 Express
    SSMS
    SQL Server 2008 Express R2 
    Now we tried to install (in normal mode with UI) the SQL Server 2008 Express R2 with SP2.
    When we chose the default SQLEXPRESS instance - it failed with the following info:
    Configuration status: Failed: see details below
    Configuration error code: 0x7FCCE689
    Configuration error description: External component has thrown an exception.
    and the Detail.txt file contained the following:
    2015-01-20 10:44:09 Slp: External component has thrown an exception.
    2015-01-20 10:44:09 Slp: The configuration failure category of current exception is ConfigurationValidationFailure
    2015-01-20 10:44:09 Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing Validation and scenario Validation.
    2015-01-20 10:44:09 Slp: System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
    2015-01-20 10:44:09 Slp: at SSisDefaultInstance(UInt16* , Int32* )
    2015-01-20 10:44:09 Slp: at Microsoft.SqlServer.Configuration.SniServer.NLRegSWrapper.NLregSNativeMethod Wrapper.SSIsDefaultInstanceName(String sInstanceName, Boolean& pfIsDefaultInstance)
    2015-01-20 10:44:09 Slp: Exception: System.Runtime.InteropServices.SEHException.
    2015-01-20 10:44:09 Slp: Source: Microsoft.SqlServer.Configuration.SniServerConfigExt.
    2015-01-20 10:44:09 Slp: Message: External component has thrown an exception..
    2015-01-20 10:44:09 Slp: Watson Bucket 1 Original Parameter Values
    2015-01-20 10:44:09 Slp: Parameter 0 : SQL Server 2008 R2@RTM@
    2015-01-20 10:44:09 Slp: Parameter 1 : SSisDefaultInstance
    2015-01-20 10:44:09 Slp: Parameter 2 : SSisDefaultInstance
    2015-01-20 10:44:09 Slp: Parameter 3 : System.Runtime.InteropServices.SEHException@-2147467259
    2015-01-20 10:44:09 Slp: Parameter 4 : System.Runtime.InteropServices.SEHException@-2147467259
    2015-01-20 10:44:09 Slp: Parameter 5 : SniServerConfigAction_Install_atValidation
    2015-01-20 10:44:09 Slp: Parameter 6 : INSTALL@VALIDATION@SQL_ENGINE_CORE_INST
    When we chose some other instance name then the installation has completed successfully.
    So the questions are:
    What could be the reason of the problem (and only for SQLEXPRESS instance that was earlier installed and then uninstalled)? I will provide the complete Detail.txt file if needed. 
    How could we check (if we could) the conditions so some name would be allowed as an instance name for SQL Server installer to success?
    With the best regards,
    Victor
    Victor Nijegorodov

    Thank you Lydia!
    Unfortunately the simple check the registry
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL does /did not work in our case since there is no any instance
    name there,
    However there seem to be some "rudiments" under
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and/or HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.
    So I will now try to check the subkeys of these two keys as it was mentioned by Xiao-Min Tan. 
    Best regards,
    Victor Nijegorodov
    Victor Nijegorodov

  • 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

  • Has mssql2008r2 got "Cumulative Update Package 6 for SQL Server 2008 Service Pack 1"

    hi,
    I have
    Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86)   Apr  2 2010 15:53:02   Copyright (c) Microsoft Corporation  Express Edition with Advanced Services on Windows NT 5.1 <X86> (Build 2600: Service Pack 3) 
    , i wanted to know has it got
    "Cumulative Update Package 6 for SQL Server 2008 Service Pack 1"
    so that i do not have to install or i have to install
    yours sincerley

    Thank u, please tel me can i instal  sp3.
    I have noticed the link of sp2 (http://www.microsoft.com/en-in/download/details.aspx?id=30437)
     has listed
    (SQL Server 2008 R2 Express Edition)
    SQL Server 2008 R2 Service Pack 2 (SP2) is now available for download. SQL Server 2008 R2 service packs are cumulative and can be used to upgrade all releases of SQL Server 2008 R2 to Service Pack 2. SQL Server 2008 R2 Service Pack 2 contains Cumulative Update
    1 to 5 from SQL Server 2008 R2 SP1. The package can be used to upgrade the following SQL Server 2008 R2 editions: 
    SQL Server 2008 R2 Parallel Computing Edition
    SQL Server 2008 R2 Datacenter Edition
    SQL Server 2008 R2 Enterprise Edition and Developer Edition
    SQL Server 2008 R2 Standard Edition
    SQL Server 2008 R2 Web Edition
    SQL Server 2008 R2 Workgroup Edition
    SQL Server 2008 R2 Express Edition
    where as link of sp3(http://www.microsoft.com/en-us/download/details.aspx?id=44271)
    has not listed express edition but written in general.
    SQL Server 2008 R2 Service Pack 3 (SP3) is now available for download. SQL Server 2008 R2 service packs are cumulative and can be used to upgrade all releases of SQL Server 2008 R2 to Service Pack 3. SQL Server 2008 R2 Service Pack 3 contains
    Cumulative Update 1 to 13 from SQL Server 2008 R2 SP2. The package can be used to upgrade the following SQL Server 2008 R2 editions: 
    SQL Server 2008 R2 Parallel Computing Edition
    SQL Server 2008 R2 Datacenter Edition
    SQL Server 2008 R2 Enterprise Edition and Developer Edition
    SQL Server 2008 R2 Standard Edition
    SQL Server 2008 R2 Web Edition
    SQL Server 2008 R2 Workgroup Edition
    yours sincerley

  • Can't connect to sql server 2008

    Hi.
    I have 2 databases running, oracle 10g express and sql server 2008 express.
    I can connect with sql developer to the oracle database, but cant establish a connection to the sql server database.
    Using the Microsoft SQL Server Management Studio i can access the database using the same parameters as in sql developer.
    I already downloaded the third party driver to access sql server databases.

    I found this solution out there on the Internet...
    http://djiang.wordpress.com/2007/02/27/using-oracle-sqldeveloper-to-access-sqlserver/
    This might help someone else, it worked for me!
    Use this connection settings:
    Connection Name: MyDataBaseName
    Username: user
    Password: password
    Hostname: localhost
    Port:1433/databaseName;instance=SQLEXPRESS

  • Moving from SQL Express to SQL Server

    Our Robosource Control v3.1 database just hit the 4GB limit with SQL Express. Could anyone pass along any advice for changing to from SQL Express to SQL Server 2008?
    Many Thanks!

    I don't have any direct experience with this, as we started off with SQL server. However, there's a promising-looking feature that might help you: the RoboSource Convert wizard (RSO3ConvertWizard.EXE), which you can get to from the Start menu. There's a selection in the Convert wizard for a 3.1 to 3.1 database copy--I'm guessing that would be what you want.
    HTH,
    G

  • Upgrade to SQL Server 2008 R2 fails

    I'm trying to upgrade from SQL Server 2008 Express to SQL Server 2008 R2 Enterprise. The installation is failing. I get two log files. The first appears to be a summary. The second is an MSI install log file. The MSI log is too large to paste in here and
    I cannot attach files, so I included the section where it appears to fail. Based on the log contents below, how can I fix this?
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2068024447
      Exit facility code:            1212
      Exit error code:               29569
      Exit message:                  Failed: see details below
      Start time:                    2015-04-06 21:07:14
      End time:                      2015-04-06 21:13:54
      Requested action:              Upgrade
      Log with failure:              C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20150406_210629\sql_engine_core_inst_ctp6_Cpu64_1.log
      Exception help link:           http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=10.50.1600.1
    Machine Properties:
      Machine name:                  DAD-PC
      Machine processor count:       12
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Product features discovered:
      Product              Instance             Instance ID                   
    Feature                                  Language            
    Edition              Version         Clustered
      Sql Server 2008      SQLEXPRESS           MSSQL10.SQLEXPRESS             Database Engine Services                
    1033                 Express Edition      10.3.5500.0     No        
      Sql Server 2008      SQLEXPRESS           MSSQL10.SQLEXPRESS             SQL Server Replication                  
    1033                 Express Edition      10.3.5500.0     No        
      Sql Server 2008                                                         
    Management Tools - Basic                 1033                 Express Edition     
    10.0.1600.22    No        
    Package properties:
      Description:                   SQL Server Database Services 2008 R2
      ProductName:                   SQL Server 2008 R2
      Type:                          RTM
      Version:                       10
      SPLevel:                       0
      Installation location:         H:\x64\setup\
      Installation edition:          ENTERPRISE
    User Input Settings:
      ACTION:                        Upgrade
      AGTDOMAINGROUP:                <empty>
      BROWSERSVCSTARTUPTYPE:         Disabled
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20150406_210629\ConfigurationFile.ini
      CUSOURCE:                      
      ENU:                           True
      ERRORREPORTING:                True
      FAILOVERCLUSTERROLLOWNERSHIP:  2
      FARMACCOUNT:                   <empty>
      FARMADMINPORT:                 0
      FARMPASSWORD:                  *****
      FTSVCACCOUNT:                  <empty>
      FTSVCPASSWORD:                 *****
      FTUPGRADEOPTION:               Import
      HELP:                          False
      IACCEPTSQLSERVERLICENSETERMS:  False
      INDICATEPROGRESS:              False
      INSTANCEID:                    SQLEXPRESS
      INSTANCENAME:                  SQLEXPRESS
      ISSVCACCOUNT:                  NT AUTHORITY\NetworkService
      ISSVCPASSWORD:                 *****
      ISSVCSTARTUPTYPE:              Automatic
      PASSPHRASE:                    *****
      PCUSOURCE:                     
      PID:                           *****
      QUIET:                         False
      QUIETSIMPLE:                   False
      RSCATALOGSERVERINSTANCENAME:   Unknown
      RSUPGRADEDATABASEACCOUNT:      
      RSUPGRADEPASSWORD:             *****
      SQLDOMAINGROUP:                <empty>
      SQMREPORTING:                  False
      UIMODE:                        Normal
      X86:                           False
      Configuration file:            C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20150406_210629\ConfigurationFile.ini
    Detailed results:
      Feature:                       Database Engine Services
      Status:                        Passed
      MSI status:                    Passed
      Configuration status:          Passed
      Feature:                       SQL Writer
      Status:                        Passed
      MSI status:                    Passed
      Configuration status:          Passed
      Feature:                       SQL Browser
      Status:                        Passed
      MSI status:                    Passed
      Configuration status:          Passed
      Feature:                       SQL Server Replication
      Status:                        Passed
      MSI status:                    Passed
      Configuration status:          Passed
      Feature:                       SQL Compact Edition Tools
      Status:                        Passed
      MSI status:                    Passed
      Configuration status:          Passed
      Feature:                       Management Tools - Basic
      Status:                        Passed
      MSI status:                    Passed
      Configuration status:          Passed
    Rules with failures:
    Global rules:
    Scenario specific rules:
    Rules report file:               C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20150406_210629\SystemConfigurationCheck_Report.htm
    PARTIAL MSI LOG BELOW
    Action start 21:13:47: AppSearch.
    MSI (s) (40:00) [21:13:47:914]: Note: 1: 1325 2: v2.0.50727
    MSI (s) (40:00) [21:13:47:914]: Note: 1: 1325 2: EventLogMessages.dll
    MSI (s) (40:00) [21:13:47:914]: PROPERTY CHANGE: Adding ASPNET_EVENTLOGDLL property. Its value is 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\EventLogMessages.dll'.
    MSI (s) (40:00) [21:13:47:915]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\\Setup 3: 2
    MSI (s) (40:00) [21:13:47:915]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FBD367D1-642F-47CF-B79B-9BE48FB34007} 3: 2
    MSI (s) (40:00) [21:13:47:915]: PROPERTY CHANGE: Adding INSTALLSQLSHAREDDIR_32 property. Its value is 'C:\Program Files (x86)\Microsoft SQL Server\'.
    MSI (s) (40:00) [21:13:47:916]: PROPERTY CHANGE: Adding INSTALLSQLSHAREDDIR_64 property. Its value is 'C:\Program Files\Microsoft SQL Server\'.
    MSI (s) (40:00) [21:13:47:916]: PROPERTY CHANGE: Adding DEVENV_IDE8 property. Its value is 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\'.
    MSI (s) (40:00) [21:13:47:917]: PROPERTY CHANGE: Adding SQLSETUPARPWRAPPER property. Its value is 'C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Release\x64\SetupARP.exe'.
    MSI (s) (40:00) [21:13:47:917]: Doing action: RestoreSetupParams_64
    Action ended 21:13:47: AppSearch. Return value 1.
    MSI (s) (40:00) [21:13:47:920]: Note: 1: 2235 2:  3: ExtendedType 4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = 'RestoreSetupParams_64'
    MSI (s) (40:C0) [21:13:47:921]: Invoking remote custom action. DLL: C:\Windows\Installer\MSICCED.tmp, Entrypoint: RestoreSetupParams
    Action start 21:13:47: RestoreSetupParams_64.
    <Func Name='LaunchFunction'>
    Function=RestoreSetupParams
    <Func Name='SetCAContext'>
    <EndFunc Name='SetCAContext' Return='T' GetLastError='203'>
    Doing Action: RestoreSetupParams
    PerfTime Start: RestoreSetupParams : Mon Apr 06 21:13:47 2015
    <Func Name='RestoreSetupParams'>
            Error Code: 0x80077381 (29569)
    Windows Error Text:   Source File Name: sqlca\sqlcax.cpp
    Compiler Timestamp: Thu Jul  3 22:23:09 2008
         Function Name: RestoreSetupParams
    Source Line Number: 190
    Error Code: 29569
    MSI (s) (40!D0) [21:13:51:016]: Product: Microsoft SQL Server 2008 Database Engine Services -- Error 29569. SQL Server Setup failed to restore the instance id.
    Error 29569. SQL Server Setup failed to restore the instance id.
    <Failure Type='Fatal' Error='29569'>
    <EndFunc Name='LaunchFunction' Return='29569' GetLastError='203'>
    CustomAction RestoreSetupParams_64 returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)

    Hello,
    You shared with us the following lines part of one of the logs created during the upgrade process:
    Error Code: 29569
     MSI (s) (40!D0) [21:13:51:016]: Product: Microsoft SQL Server 2008 Database Engine Services -- Error
    29569. SQL
    Server Setup failed to restore the instance id.
    These lines are associated with Registry corruption. If this instance is a production instance, please call Microsoft Support for help.
    For more information, please read the answer provided by Cathy Miller (MSFT) on the following thread.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/15a67403-3e67-47cd-8595-4330945bd6cc/sql-server-2008-sp2-update-fails-error-29569-sql-server-setup-failed-to-restore-the-instance-id?forum=sqlsetupandupgrade
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server 2008 Express - timeout issues, "This SqlTransaction has completed; it is no longer usable."

    Good morning all!   I work for a small business that uses a robust Accounting/Inventory database called Traverse (or Open Systems) and is run on a desktop computer using SQL Server 2008 Express.
    We don't have an IT department, but I have a bit of knowledge, so I've been the go-to person to handle any tech support issues in our tiny 5 person office.  I've been reading up on SQL Server 2008 Express, but am completely stumped on this issue.
    Our database would work consistently well for quite a while - sometimes getting disconnected from the server and requiring a restart of either the SQL Server itself or the Traverse License Server.
    About two weeks ago, I noticed that nobody had ever run Windows Update on the desktop that we have SQL Server on, so I spent the better part of a day updating everything, hoping it would help some of the little buggy issues we've been having.   Unfortunately,
    by applying the updates, I think it may have altered settings - or updated appropriately and our functionality is diminished.
    Basically, we have 3 users connecting into the server to use the database at any time.  Sometimes we might not be accessing information constantly, and it appears we're getting a timeout message in the SQL Server Log - stating the system was awoken
    by user activity after around 25-30 minutes.  When this happens, the system is painfully slow and locks up, giving SQL Server Connection errors, or the "This SqlTransaction has completed; it is no longer usable." message.   I noticed that
    there is a connection timeout of 15 seconds set for our SQL Server, but it's greyed out in the dialog box I saw it in, and am not sure if that's even a culprit.
    I'd just like to get this working again to where we can continue to use the database throughout the day without waiting for it to seemingly load all of the data after "waking up".  It's to a point that one of my employees is coming into my
    office every 5 minutes complaining that she can't do anything in Traverse.  I'm about to lose my mind!  
    If anyone has any clue what could be the issue, I'd be so grateful for help.  If you need any logs, messages, etc.. please let me know which and I will share them.  Thank you again!

    This is known as the Zombie Check exception. It is generally caused by trying to commit a transaction twice or trying to roll back a committed transaction. It can also be caused by a connection closing before the transaction is complete. In you case I would
    suspect the latter.
    See this article on setting the default timeout.
    Andy Tauber
    Data Architect
    The Vancouver Clinic
    Website | LinkedIn
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • SQL Server 2008 Express Installation with command line options , FAILED.

    HI,
    I Have SQL Server 2005 Express instances on my PC. Now i am trying to install 2008 Express edition with Advance Services(Reporting.)
    I am trying to install the SQL Server 2008 Express with command line Options.
    /qs /Action=Install /Hideconsole /SecurityMode=SQL /Features=SQL,Tools,RS /InstanceName=XXXXXX /SAPWD="StrongPassword" /SQLSYSADMINACCOUNTS="Builtin\Administrators" /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /RSSVCACCOUNT="NT
    AUTHORITY\SYSTEM" /BROWSERSVCSTARTUPTYPE=Automatic /TCPENABLED=1 /NPENABLED=1
    But installation exits. It says the previous version 2005 tool are already exists, Remove them to Continue the 2008 Server Installation.
    please suggest me how to avoid that check and continue installation by replacing the older tool with 2008 automatically.
    regards 
    Pratap M:)

    Have you found any error in event logs?
    In my case even after uninstalling all 2005 related components it didn't worked. I had to resort to a brute force way and
    remove following registry keys
    32 Bit OS: HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\90
    64 Bit OS: HKLM\Software\Wow6432Node\Microsoft\Microsoft SQL Server\90
    Check below threads
    http://stackoverflow.com/questions/175881/sql-server-express-2008-install-side-by-side-w-sql-2005-express-fails
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/5fc58507-9f40-4213-acbd-32a57c8822d7/cant-uninstall-sql-server-2005-express-tools?forum=sqlsetupandupgrade
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • How to install SQL server 2008 express on Windows server 2008 R2 standard OS

    Hi,
    I have Windows server 2008 R2 Standard edition (64-bit) and trying to install SQL server 2008 express edition since I do not have SQL server 2008. When I install it I am unable to see Management Studio so I am trying to install management studio as well
    but still I am facing issue. Please let me know whether SQL server 2008 express edition is compatible with  Windows server 2008 R2 Standard. If not then pls let me know the proper steps to install it.
    Regds

    Hello,
    Service Pack 1 for SQL Server 2008 is required to be compatible with Windows Server 2008 R2.
    Please download QL Server 2008 Express with SP1 included from the following link:
    http://www.microsoft.com/en-us/download/details.aspx?id=25052
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server 2008 R2 Std with SQL Server 2005 Express Subscriptions

    If we have SQL Server 2005 Express Merge Replication Subscriptions that synch to a SQL Server 2008 R2 Standard Edition. Do
    the Subscriptions still have same file size limitations even though they synch to a Proper Standard Version of SQL Server 2008?
    If so what are these limitations?
    What happens in the instance where by the server file becomes huge then the Subscriptions will not allow the data to replicate
    as the Express Subscription engine has a file size limitation - or does this not matter??

    You will get messages on your SQL Server Express  servers that the merge agent cannot write to the SQL Express database. These messages are difficult to debug as you don't get a warning you have exceeded the size limit on the subscriber.
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

  • How to Configure Remote Connections To SQL Server 2008 R2 Express

    Post written June 10, 2010 and pertains to:
    SQL Server 2008 R2 Express on both my server and local machines: SQLX_SRV,
    SQLX_LOC
    SQL Server 2008 R2 Management Studio on both my server and local machines:
    MS_SRV, MS_LOC
    Windows Server 2008 R2 Enterprise installed on a Hyper-V VPS: WS
    SQL Server Configuration Manager on both my server and local machines:
    CMGR_SRV, CMGR_LOC
    Server Manager: SMGR
    I am connecting to my hosting server via Remote Desktop Connection: RDC
    I installed SQLX_SRV and MS_SRV on my hosting server and SQLX_LOC and MS_LOC on my local development machine.  I am able to use MS_LOC to connect to SQLX_LOC and to use MS_SRV to connect to SQLX_SRV.  However I am not able to use MS_LOC to connect
    with SQLX_SRV.  Here's what I have done so far:
    SMGR -> Configuration -> Windows Firewall to turn off the Windows Firewall for Domain, Private and Public profiles.  Obviously I'll change this later, but until I can connect I want to remove as many variables as possible.
    CMGR_SRV -> SQL Server Services to confirm that both SQL Server (SQLEXPRESS) and SQL Server Browser services were running.
    CMGR_SRV -> SQL Server Network Configuration -> Protocols for SQLEXPRESS to ENABLE the Shared Memory, Named Pipes, and TCP/IP protocols and DISABLE the deprecated VIA protocol.
    CMGR_SRV -> SQL Server Network Configuration -> Protocols for SQLEXPRESS -> double click TCP/IP to open the TCP/IP properties dialogue.  On the Protocol tab Enabled: Yes, Keep Alive: 30000, changed Listen All to No.  I've tried it both
    ways, but I've got six IP addresses on my server and I wanted to configure SQLEXPRESS to listen to only the first and primary IP.  On the IP Addresses tab went to IPALL and cleared the TCP Dynamic Ports field and entered 1433 in the TCP Port field. 
    For my first and primary IP Address I made sure that Enabled was Yes, I cleared the TCP Dynamic Ports field, and entered 1433 in the TCP Port field.  For all other IP Addresses Enabled was set to No and I cleared both the TCP Dynamic Ports and TCP Port
    fields.
    CMGR_SRV -> SQL Server Services -> SQL Server (SQLEXPRESS) right click and Restart.  This of course stopped and restarted my instance of SQLX_SRV enabling the TCP/IP configuration in the previous step to take effect.
    On my server, SQLX_SRV is the only instance of SQL Server running and so it's easy to hard wire it to the default port 1433.
    The instance name for both SQLX_SRV and SQLX_LOC is the default "SQLEXPRESS".  My server machine name is "SERVER1" on the EnglishBrains.com domain.  So the proper local name (local within the context of my remote server as connected via RDC) for
    my instance of SQLX_SRV would be:
    SERVER1\SQLEXPRESS 
    Note the use of a backslash NOT a forward slash. 
    Of course to connect remotely from my development machine, which is not on the same domain as my hosting server, I would need to specify the domain as well, so the SQL Server name becomes:
    SERVER1.EnglishBrains.com\SQLEXPRESS
    I must also use SQL Server Authentication.  Before I can use such a remote connection, however, there are still several configuration steps required.  So on my server (connected via RDC) I used MS_SRV to connect to SQLX_SRV using SERVER1\SQLEXPRESS
    for the server name and Windows Authentication.  Once connected I performed the following steps:
    MS_SRV -> right click the connected parent SERVER1\SQLEXPRESS instance node at the top -> Properties -> Security -> Server authentication: select "SQL Server and Windows Authentication mode".  This will enable connections using either type
    of authentication.
    Next, leaving the Server Properties dialogue open, Connections -> check "Allow remote connections to this server" box.
    Click OK to save these changes and close the Server Properties dialogue.
    MS_SRV -> Security -> right click Logins and select "New Login...", the Login - New dialogue opens.
    On the General page Enter a name for your new login
    Select SQL Server Authorization
    Enter and confirm a password
    Uncheck Enforce password expiration
    Select the default Database and Language
    On the ServerRoles page Public will be checked, also check SysAdmin.  This is probably not a good idea and I'll uncheck this as soon as I can connect to the SQLX_SRV.
    On the User Mapping page select the databases you want your new Login to access and enter the Default Schema of "dbo".
    At the bottom of the User Mapping page you'll see the Database Roles table.  Public will be selected by default.  Also select db_Owner.  Again this is probably not a good idea, and I'll refine this once I can connect.
    On the Status page confirm that "Grant" is checked under "Permission to connect to database engine" and "Enable" is checked under "Login".
    Click OK to save all changes and close the Login - New dialogue.
    With these steps completed you should now be able to use MS_SRV to connect to SQLX_SRV using SQL Server Authentication by supplying the name and password for your new Login.  I tried this and it worked fine.  Next I tried to use this same login
    remotely, that is I went to my local development machine and used MS_LOC to try and connect to SQLX_SRV by using
    SERVER1.EnglishBrains.com\SQLEXPRESS
    and opting for SQL Server Authentication and supplying the name and password of my new login.
    THIS DID NOT WORK??  Instead I get the following error message:
    Cannot connect to SERVER1.EnglishBrains.com\SQLEXPRESS.
    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)
    For help, click:
    http://www.microsoft.com/products/ee/transform.aspx?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1
    If you follow the suggested help link, you are told:
    The SQL Server client cannot connect to the server.  This error could be caused by one of the following reasons:
    A specified SQL Server instance name is not valid.
    The TCP, or named pipes protocols are not enabled.
    The firewall on the server has refused the connection.
    The SQL Server Browser service (sqlbrowser) is not started.
    WRONG on all 4 counts!  The instance name IS valid.  Both TCP/IP and Named Pipes protocols are enabled.  The firewall has been shut down, so it is not relevant.  Finally the SQL Server Browser IS started.
    The next thing I tried was to circumvent discovery by the SQL Browser service by using the following syntax to specify the IP address and port directly when specifying the SQL Server name.
    tcp:68.71.134.186,1433
    Using this in the Server Name field I was able to use MS_SRV to successfully connect to SQLX_SRV (using SQL Server Authentication of course) with or without the SQL Browser service running. 
    However when I tried to connect from MS_LOC to SQLX_SRV using this same login (WITH SQL Browser service running just for good measure) it does not work??  I get the following error message:
    Cannot connect to tcp:68.71.134.186,1433.
    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:
    TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)
    For help, click:
    http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=10060&LinkId=20476
    If you follow the help link you are told:
    "The SQL Server client cannot connect to the server. This error could occur because either the firewall on the server has refused the connection or the server is not configured to accept remote connections."
    However, the firewall has been shut down and the server HAS been configured to accept remote connections! 
    I confirmed that i could indeed Ping to 68.71.134.186  and running NetStat -a |find /i "listening" on the server shows that the server is indeed listening at 68.71.134.186 Port 1433 -- which is why I was able to connect to SQLX_SRV using MS_SRV with
    tcp:68.71.134.186,1433 .
    IN SUMMARY: Even though I can connect to my SQLEXPRESS instance multiple ways from the server itself, I cannot connect remotely from my development machine! 
    If anyone can help me figure out why I would be very, very grateful!

    My two cents to help you out on c# code example to configure the remote sql server express.
    Hope it helps. It works, but you have to be extra carefull to read it all and setup the server configuration and netsh commands; also the port fowarding on the router.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data.SqlClient;
    namespace sqlremoteconnection
    class Program
    static void Main(string[] args)
    // this is the local sql server connection
    // 192.168.1.101\SQLEXPRESS
    // now, the configuration for remote access:
    // activate SQL SERVER BROWSER - set it to start "automatic"; then START UP
    // SQL Server Configuration Manager
    // --> SQL SERVER BROWSER -> properties -> Service -> Start Mode -> automatic -> apply
    // --> Log On -> Start -> Ok
                // netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = all profile = CURRENT
                // netsh firewall set portopening protocol = UDP port = 1434 name = SQLPort mode = ENABLE scope = all profile = CURRENT
                // netsh advfirewall firewall add rule name = SQLPort dir = in protocol = tcp action = allow localport = 1433 remoteip = any profile = PUBLIC
                // netsh advfirewall firewall add rule name = SQLPort dir = in protocol = udp action = allow localport = 1434 remoteip = any profile = PUBLIC
    // VERY IMPORTANT FOR REMOTE ACCESS: you have to add the rules on port fowarding
    // on the router!!!
    // TCP: 1433
    // UDP: 1434
    // or just a personal port like TCP 31433/UDP 31434
    // read carefully the netsh commands above
    // server name: 123.132.24.177\SQLEXPRESS
    // server name: anyurl.myftp.org\SQLEXPRESS,1433 <<-- regular port
    // server name: anyurl.myftp.org\SQLEXPRESS
    // server name: anyurl.myftp.org\SQLEXPRESS,31433 <<-- WOW different PORT here!!!
    SqlConnection myConnection = new SqlConnection(
    "user id=sa;" +
    "password=password_goes_here!;" +
    "server=anyurl.myftp.org\\SQLEXPRESS,31433;" +
    //"Trusted_Connection=no;" +
    "database=database_name_here; " +
    "connection timeout=30");
    try
    myConnection.Open();
    catch (Exception e)
    Console.WriteLine(e.ToString());
    try
    SqlDataReader myReader = null;
    SqlCommand myCommand = new SqlCommand("select * from mytable", myConnection);
    myReader = myCommand.ExecuteReader();
    while (myReader.Read())
    Console.WriteLine(myReader["tab01_name"].ToString());
    Console.WriteLine(myReader["tab01_age"].ToString());
    catch (Exception e)
    Console.WriteLine(e.ToString());
    try
    myConnection.Close();
    catch (Exception e)
    Console.WriteLine(e.ToString());
    Adelino Araujo

  • Sa's password in SQL Server 2008 R2 Express

    Hi,
    In the SQL Server 2005 Express I can chose  the expert mode during the installation. This enables me to set the password  of the user “sa”.
    Now I tried to install SQL Server 2008 R2 Express but I had no possibility to change / set the password of the user “sa”.
    I read in the internet that the default-password of the user “sa” should be a blank password. Since in SQL Server 2008 R2 Express there was no way to set / change “sa”’s password I tried to login with a blank password. But this
    also didn’t worked.
    So my questions are:
    1.    Where during the SQL Server 2008 R2 Express setup can I set / change the “sa”’s password.
    2.    Where in the SQL Server 2008 R2 Express can I set / change the “sa”’s password after the installation.
    3.    What’s the default password of “sa” in SQL Server 2008 R2 Express?
    4.    Why a blank password for the unmodified “sa” account didn’t worked? 
    Thank in advance for all your helpful answers.

    I am not sure whether you found a solution for sa password reset in 2k8 express. May be useful to others.
    Steps to reset the password:
    1. Go to SQL Server Properties/Security tab and change the mode to SQL Server authentication mode
    2. Go to security/logins, open SA login properties
    a. Uncheck "Enforce password policy" and "Enforce password expiration" check box there if you decide
    to use weak password
    b. Assign password to SA user
    3. In SQL 2k8, we may get the following error when we reset the password,
    "Cannot set a credential for principal 'sa' . (Microsoft SQL Server, Error: 15535)"
    Resolution:
    but this can be fixed by selecting the "Map To Credential" check box on the General tab of the Login
    Properties - sa dialog box.
    4. You may get the following error after above step,
    “User is not associated with a trusted sql server connection"
    Resolution:
    In SQL Server Management Studio, Right-click the Server name, select Properties > Security
    Under Server Authentication, select SQL Server and Windows Authentication Mode
    The server must be stopped and re-started before this will take effect.
    5. Make sure the sa (at status tab of sa properties) is enabled after restart the server.
    It works =)!!!!!!!!! Thanks man =)

  • SQL Server 2008 Express SP1 installation failed

    Hello guys,
    System Info:
    Windows 7 64Bit.
    Scenario: I have an application, while installation it installs SQLServer 2008 instance with some xyz database name.
    Issue: The system already has the SQLServer 2008 R2, and now I am trying to install the application but the SQLServer instance of my application is not getting installed, its giving error saying that the installation failed.
    The error code is :
    0x84B40000
    The below is the log file data.
    07/07/2014 16:15:14.283 ======================================================================
    07/07/2014 16:15:14.283 Setup launched
    07/07/2014 16:15:14.298 Attempting to determine media source
    07/07/2014 16:15:14.298 Media source value not specified on command line argument.
    07/07/2014 16:15:14.298 Setup is launched from media directly so default the value to the current folder.
    07/07/2014 16:15:14.298 Media source: c:\80424454fe36892978\
    07/07/2014 16:15:14.298 Attempt to determine media layout based on file 'c:\80424454fe36892978\mediainfo.xml'.
    07/07/2014 16:15:14.361 Media layout is detected as: Core
    07/07/2014 16:15:14.361 Media LCID is detected as: 1033
    07/07/2014 16:15:14.361 Media is a slipstream package
    07/07/2014 16:15:14.361 Only patch related actions can run patch setup.exe, so continuing to run setup.exe from media.
    07/07/2014 16:15:14.361 /? or /HELP or /ACTION=HELP specified: false
    07/07/2014 16:15:14.361 Help display: false
    07/07/2014 16:15:14.361 Checking to see if we need to install .Net version 2.0
    07/07/2014 16:15:14.376 Determining the cluster status of the local machine.
    07/07/2014 16:15:14.376 The local machine is not configured as a cluster node.
    07/07/2014 16:15:14.376 Attempting to find media for .Net version 2.0
    07/07/2014 16:15:14.376 .Net version 2.0 is installed
    07/07/2014 16:15:14.376 RedistMSI::GetExpectedBuildRevision - Setup expects MSI 4.5.6001.22159 at the minimum
    07/07/2014 16:15:14.376 Attempting to get Windows Installer version
    07/07/2014 16:15:14.376 Windows Installer version detected: 5.0.7601.17807
    07/07/2014 16:15:14.376 RedistMSI::IsVistaRTM - Not Vista RTM build
    07/07/2014 16:15:14.392 Required version of Windows Installer is already installed
    07/07/2014 16:15:14.392 Current running setup.exe full path: c:\80424454fe36892978\setup.exe
    07/07/2014 16:15:14.392 Media setup.exe file version detected: 2007.100.2731.23
    07/07/2014 16:15:14.392 Locally installed setup.exe full path: c:\Program Files (x86)\Microsoft SQL Server\100\Setup Bootstrap\Release\setup.exe
    07/07/2014 16:15:14.408 Local setup.exe file version detected: 2007.100.2731.23
    07/07/2014 16:15:14.408 Local setup.exe version 2007.100.2731.23 is equal or greater than media version 2007.100.2731.23, so re-launching setup.exe from local
    07/07/2014 16:15:14.408 Media source: c:\80424454fe36892978\
    07/07/2014 16:15:14.408 Install media path: c:\80424454fe36892978\x86\setup\
    07/07/2014 16:15:14.423 Media layout: Core
    07/07/2014 16:15:14.423 Attempting to get execution timestamp
    07/07/2014 16:15:14.423 Timestamp: 20140707_161514
    07/07/2014 16:15:14.439 Attempting to launch local setup.exe
    07/07/2014 16:15:14.439 Attempting to launch process c:\Program Files (x86)\Microsoft SQL Server\100\Setup Bootstrap\Release\setup.exe
    07/07/2014 16:15:38.962 Process returned exit code: 0x84B40000
    07/07/2014 16:15:38.962 Local setup.exe returned exit code: 0x84B40000
    07/07/2014 16:15:38.962 Setup closed with exit code: 0x84C40013
    07/07/2014 16:15:38.962 ======================================================================
    Please do reply if anyone knows how to fix this issue.
    Thanks,
    Shiv
    0x84B40000

    Hi,
    You can install SQL server express 2008 on machine having SQL Server 2008 r2 is supported. From what you posted I guess SQL server 2008 r2 is default instance so you need to install SQL server 2008 express SP1 as named instance. Your error matches problem
    mentioned in below thread
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1e8cfab3-4b99-4b4d-82bf-97799dabe34c/failure-when-installing-from-command-prompt-config-file?forum=sqlexpress
    If issue is not solved please post complete  log files from location
    %programfiles%\Microsoft SQL Server\100\Setup Bootstrap\Log\.
    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 Articles

Maybe you are looking for

  • ITunes 11.0.2.26 was not successfully installed

    Can someone help me??? Seems like iTunes is not successfully installed in my laptop. It says that iTunes was successfully installed but the truth is there are no folders made in installing iTunes, even the icon in my desktop. I've tried this maybe 5

  • Error while creating service tickets

    Hi all, we are facing the followin error when we try to create a service ticket in WEB UI. Version CRM 7 with EhP1 installed. Please find the error details Context initialization failed in view ICCMP_BTPARTNER/PartnerTable of UI Component ICCMP_BTPAR

  • Change logs for EP7.0

    Hello Gurus, How do we find change logs for user creation, role assignements etc in EP 7.0? Thanks in advance.

  • Down Payment Clearing pushbutton in MIRO (SAP ECC6 EP4)

    Dear Experts, As i am trying to do the same process in my organisation to post the DP in PO at header or item level and after that following the ME2DP process for posting DP and then i do MIGO. After GR as i do MIRO process and select the PO there is

  • String encoding problem - pls help.

    I need to read in a string, let say as aString (in ASCII) inside my program will produce astring, bString i want the string b in unicode and insert to string a. but string a need to be ascii. structure like: for example: aString = "<datetime id numbe