SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for May, 2011

The SQL Server Agent service does not start after you upgrade from SQL Server 2008 Express or from SQL Server 2008 Express with Advanced Services to SQL Server 2008 Developer, to SQL Server 2008 …

Symptoms
Consider the following scenario. You install Microsoft SQL Server 2008 Express or Microsoft SQL Server 2008 Express with Advanced Services.You upgrade to Microsoft SQL Server 2008 Developer, to Microsoft SQL Server 2008 Enterprise, or to Microsoft SQL Server 2008 Standard by using the following command-line command:
setup.exe /action=editionupgrade /instancename=instance name /pid=appropriate edition product IDOr, you upgrade to SQL Server 2008 Developer, to SQL Server 2008 Enterprise, or to SQL Server 2008 Standard by using the Setup Graphical User Interface (GUI).You start the Service Control Manager.
Note To do this, click Start, click Run, and then type services.msc.You locate the SQL Server Agent service and then try to start the service.In this scenario, the SQL Server Agent service does not start successfully. Additionally, the following error message is recorded in the event log:

SQLServerAgent could not be started (reason: Error creating a new session)
Resolution
This issue occurs because in SQL Server 2008 Express and in SQL Server 2008 Express with Advanced Services, the SQL Server Agent service is created but not enabled. This condition is by design.

The SQL Server 2008 Integrated Services OLE DB Source adapter may obtain only the first row of a source table when you use a Sybase Adaptive Server Enterprise OLE DB provider

Symptoms
When you use a Sybase Adaptive Server Enterprise OLE DB provider, the Microsoft SQL Server 2008 Integrated Services (SSIS) OLE DB Source adapter may obtain only the first row of a source table. This problem may occureven if the following conditions are true:More rowsare stored in the source table on the Sybase server.The Integrated Services package seems to execute successfully.
Resolution
This problem may occur when the DBPROP_MAXROWS property is used to specify the maximum size of a rowset. In the SQL Server validation phase, the DBPROP_MAXROWS property is setto help performance. This is because the whole dataset is not needed for validation. However, the DBPROP_MAXROWS property may not be supported, or it may cause unintended consequences in SQL Server statement execution for certain versions of Sybase OLE DB providers. The unintended consequences in SQL Server statement execution may cause data corruption even though an Integrated Services package seems to execute successfully. For more information about when this can be a problem, see the “More Information” section.
For more information about the DBPROP_MAXROWSproperty, visit the following Microsoft Web site:
http://technet.microsoft.com/en-us/library/ms131271(SQL.100).aspx(http://technet.microsoft.com/en-us/library/ms131271(SQL.100).aspx)

The SQL Server 2008 Installation Wizard has the “Named instance” option pre-selected when you try to upgrade the default instance

Symptoms
When you run the SQL Server Installation Wizard to upgrade the default instance of Microsoft SQL Server to SQL Server 2008, the Named instance option on the Instance Configuration page is pre-selected. Additionally, the Name instance box has a value of MSSQLSERVER.The Named instance option and the Named instance box are unavailable and cannot be changed.
Resolution
There is currently no resolution or workaround for this problem.

The SQL Server 2008 installation process may fail if the server alias is defined in the Client Network Utility

Symptoms
When you try to install Microsoft SQL Server 2008, the installation process mayfail. Additionally, the following error may be written to the setup log:

DateTime Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing ConfigRC and scenario ConfigRC.
DateTime Slp Slp: Microsoft.SqlServer.Configuration.Sco.ScoException: 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 – No connection could be made because the target machine actively refused it.)
System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.When connecting to SQL Server Version,, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.)This problem occurs if you have defined a server alias in the Client Network Utility for a protocol other than Shared Memory.
Resolution
This problem occurs because the user-defined server alias does not allow for shared memory connections.

The Setup.exe program is unable to remove security code groups that were created during the installation of SQL Server 2008

Symptoms
Consider the following scenario. You run the Setup.exe program to install Microsoft SQL Server 2008. The Setup.exe program is stopped suddenly before it is completed, either intentionally or because of a power failure. In this scenario, the Setup.exe program is unable to remove security code groups that were created during the installation. Therefore, the computer may be left vulnerable to attack.
Note Code groups are created to allow for users to run the Setup.exe program from a network share.
Resolution
To work around this problem, use the Code Access Security Policy tool to manually remove the security code groups. To do this, follow these steps.
Notes You must have machine-level security policy to use the Code Access Security Policy tool.For more information, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn.microsoft.com/en-us/library/cb6t8dtz(VS.80).aspx(http://msdn.microsoft.com/en-us/library/cb6t8dtz(VS.80).aspx)If the Code Access Security Policy tool is not located on the computer, reinstallthe Microsoft .NET Framework 3.5. To download the .NET Framework 3.5, visit the following Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?familyid=333325fd-ae52-4e35-b531-508d977d32a6&displaylang=en(http://www.microsoft.com/downloads/details.aspx?familyid=333325fd-ae52-4e35-b531-508d977d32a6&displaylang=en)Click Start, click Run, type cmd, and then click OK.Locate one orboth of the following folders, depending on your operating system:
32-bit editions of Windows
%systemdrive%\Microsoft.NET\Framework\v2.0.50727
64-bit editions of Windows
Note In 64-bit editions of Windows, you must run the CasPol.exe –q –rg code group command in the following folders: %systemdrive%\Microsoft.NET\Framework\v2.0.50727%systemdrive%\Microsoft.NET\Framework64\v2.0.50727For each security code group that is listed in this step, type the following command, and then press ENTER.
Note You do not have to restart the computer after you run the command for each security code group.
Command
CasPol.exe -q -rg code_group_nameNote In this command, the placeholder code_group_name represents the name of the security code group.
Security code groupsMSVCM80MICROSOFT.SQLSERVER.CHAINER.SETUPMICROSOFT.SQL.CHAINER.PACKAGEMICROSOFT.SQLSERVER.CHAINER.INFRASTRUCTUREMICROSOFT.SQLSERVER.CONFIGURATION.BOOTSTRAPEXTENSIONMICROSOFT.SQLSERVER.SETUP.CHAINER.WORKFLOWMICROSOFT.SQLSERVER.CONFIGURATION.SQLCONFIGBASEMICROSOFT.SQLSERVER.CONFIGURATION.SFCMICROSOFT.SQLSERVER.CONFIGURATION.SETUPEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.MSIEXTENSIONMICROSOFT.SQLSERVER.CHAINER.EXTENSIONCOMMONMICROSOFT.SQLSERVER.CONFIGURATION.SCOMICROSOFT.SQLSERVER.CONFIGURATION.CONFIGEXTENSIONMICROSOFT.SQLSERVER.DISCOVERYMICROSOFT.SQLSERVER.CONFIGURATION.UIEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.SSTRINGMICROSOFT.SQLSERVER.CONFIGURATION.WIZARDFRAMEWORKMICROSOFT.SQLSERVER.CONFIGURATION.INSTALLWIZARDFRAMEWORKMICROSOFT.SQLSERVER.CONFIGURATION.INSTALLWIZARDMICROSOFT.SQLSERVER.MANAGEMENT.CONTROLSMICROSOFT.SQLSERVER.CONFIGURATIONMICROSOFT.SQLSERVER.CONFIGURATION.CONNECTIONINFOMICROSOFT.SQLSERVER.CONFIGURATION.RULESENGINEEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.CLUSTERMSCLUSTERLIBMICROSOFT.SQL.CHAINER.PACKAGEDATAMICROSOFT.SQL.CHAINER.PRODUCTMICROSOFT.NETENTERPRISESERVERS.EXCEPTIONMESSAGEBOXLANDINGPAGEMICROSOFT.SQLSERVER.CONFIGURATION.SLPEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.AGENTEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.POWERSHELLEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.SSISEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.ASEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.REPL_CONFIGEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.MANAGEMENTTOOLSEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.SQLSERVER_CONFIGEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.SNISERVERCONFIGEXTMICROSOFT.SQLSERVER.CONFIGURATION.SQLBROWSEREXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.RSEXTENSIONMICROSOFT.SQLSERVER.CONFIGURATION.DMFMICROSOFT.SQLSERVER.CONFIGURATION.SMOMICROSOFT.SQLSERVER.CONFIGURATION.SQLENUMMICROSOFT.SQLSERVER.CONFIGURATION.FULLTEXT_CONFIGEXTENSIONFIXSQLREGISTRYKEYMICROSOFT.SQLSERVER.CHAINER.SETUP.RESOURCESMICROSOFT.SQLSERVER.CHAINER.INFRASTRUCTURE.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.BOOTSTRAPEXTENSION.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.SQLCONFIGBASE.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.SFC.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.SETUPEXTENSION.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.MSIEXTENSION.RESOURCESMICROSOFT.SQLSERVER.CHAINER.EXTENSIONCOMMON.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.SCO.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.CONFIGEXTENSION.RESOURCESMICROSOFT.SQLSERVER.DISCOVERY.RESOURCESMICROSOFT.SQLSERVER.CONNECTIONINFO.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.UIEXTENSION.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.WIZARDFRAMEWORK.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.INSTALLWIZARDFRAMEWORK.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.INSTALLWIZARD.RESOURCESMICROSOFT.SQLSERVER.MANAGEMENT.CONTROLS.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.CONNECTIONINFO.RESOURCESMICROSOFT.SQLSERVER.CONFIGURATION.RULESENGINEEXTENSION.RESOURCESLANDINGPAGE.RESOURCESIf the security code group is not located on the computer, the following error message is returned:

1. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>caspol -remgroup blah
2. Microsoft (R) .NET Framework CasPol 2.0.50727.1433
3. Copyright (c) Microsoft Corporation.All rights reserved.
4.
5. ERROR: Invalid label or name
6.
7. Usage: caspol <option> <args> …
8.
9. caspol -rg
10. caspol -remgroup <label|name>
11. Remove code group at <label|name>
12.
13.
14. where “<mship>” can be:
15. -allcodeAll code
16. -appdirApplication directory
17. -custom <xml_file>Custom membership condition
18. -hash <hashAlg> {-hex <hashValue>|-file <assembly_name>}
19. Assembly hash
20. -pub {-cert <cert_file_name> | -file <signed_file_name> | -hex <hex_string>}
21. Software publisher
22. -gacInstalled in the Global Assembly Cache
23. -site <website>Site
24. -strong {-file <assemblyfile_name> | -hex <public_key>}
25. {<name> | -noname} {<version> | -noversion}
26. Strong name
27. -url <url>URL
28. -zone <zone_name>Zone, where zone can be:
29. MyComputer
30. Intranet
31. Trusted
32. Internet
33. Untrusted
34.
35. where “<flag>” can be any combination of:
36. -exclusive {on|off}
37. Set the policy statement Exclusive flag
38. -levelfinal {on|off}
39. Set the policy statement LevelFinal flag
40. -n[ame] <name>
41. Code group name
42. -d[escription] <desc>
43. Code group description
44.
45. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>If the security code group is deleted when you run the caspol.exe –q –rg code group command, the following message is returned:
1. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>caspol -remgroup blah
2. Microsoft (R) .NET Framework CasPol 2.0.50727.1433
3. Copyright (c) Microsoft Corporation.All rights reserved.
4.
5. The operation you are performing will alter security policy.
6. Are you sure you want to perform this operation? (yes/no)
7. y
8. Removed code group from the Machine level.
9. Success