ORDER BY on SQL Server

I just switched a site from Access to SQL server. I have a
page that in
Access used a ORDER BY statement that referenced a
QueryString variable.
But when I try that on SQL Server, it's saying that it only
supports
variables that reference a column name (instead of a query
string). Is
there a work around to this or something else I can do to
make the results
sort by a QueryString instead of a db column name?
Brandon
==================
Presentations Direct -
http://www.presentationsdirect.com
> Binding Machines
http://www.presentationsdirect.com/binding-machines/gbc-binding-machines.asp
> Laminators
http://www.presentationsdirect.com/laminators/gbc-laminators.asp
> Paper Shredders
http://www.presentationsdirect.com/paper-shredders/gbc-paper-shredders.asp
==================

ORDER BY is always a column name, regardless. It's the nature
of SQL. Now,
if you have a database column name in your querystring, then
you can
certainly use it. For example;
http://www.mysite.com/details.asp?order=name
rsRecordset.CommandText = "SELECT * FROM MyTable ORDER BY"
Request.QueryString("order") & " ASC"
But keep in mind that the "order" parameter has to be a valid
database
column name, else it's going to throw an error about not
being able to find
the specified column. The above assumes that you have a
database column
called "name".
Hope that makes sense.
Best regards,
Chris

Similar Messages

  • Order by in SQL Server

    I have data in table as below.My requirement is -->result should come in descending menu order i.e highest menu order should come first and if
    two records have same Menu order then the highest LastUpdatedDateTime   in those 2 records should come first
    LastUpdatedDateTime         MenuOrder
    2015-04-08 05:37:04.513       6
    2015-04-08 05:37:10.783       1
    Help me in writing the query for the same.
    i tried like select LastUpdatedDateTime,MenuOrder from Table1 order by MenuOrder,LastUpdatedDateTime desc --->but in the result lowset LastUpdatedDateTime is coming first if Menuorder is duplicated

    CREATE TABLE #t (LastUpdatedDateTime  DATE,MenuOrder INT)
    INSERT INTO #t VALUES ('20150401',6),('20150402',6),('20150301',2),('20150402',3)
    SELECT * FROM #t ORDER BY MenuOrder DESC,LastUpdatedDateTime DESC
    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

  • Steps to connect SQL Server to Oracle works but WHY ??

    The following steps is what I have to do in order to get SQL Server to talk to an Oracle database.
    These steps, for me, work 100% of the time. Any deviation from the following steps will result in failure.
    Rebooting the machine didn't make any difference between each of the steps.
    My question is why I have to install the client a second time?
    All the documentation that I have found at Oracle, Microsoft, or elsewhere state that I only need the InstantClient.
    =========================================
    Some server I don't have access to
    with Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit installed
    Windows XP SP3 - 32bit
    with Microsoft SQL Server 2005 SP3 installed
    The following steps are done on the Windows XP machine.
    1) install win32_11gR2_client
    Select: InstantClient (174.0MB)
    Path: C:\Oracle
    2) install ODTwithODAC112021
    Select: Oracle Data Access Components for Oracle Client
    Oracle Base: C:\Oracle
    Name: OraClient11g_home1
    Path: C:\Oracle\product\11.2.0\client_1
    3) Add entries for tnsnames.ora and sqlnet.ora
    4) Ensure environmental variable ORACLE_HOME is set to C:\Oracle\product\11.2.0\client_1
    5) SQL Server Management Studio
    Check "Allow Inprocess" for Oracle Provider OraOLEDB.Oracle
    Restart SQL Server
    Try to add link to Oracle - fails to connect
    "The test connection to the linked server failed."
    Additional information:
    An exception occurred while executing a Transact-SQL statement or batch.
    (Microsoft.SqlServer.ConnectionInfo)
    Cannot initialize the data source object of OLE DB Provider "OraOLEDB.Oracle" for linked server "ORACLEDB".
    OLE DB provider "OraOLEDB.Oracle" for linked server "ORACLEDB" returned message "".
    (Microsoft SQL Server, Error: 7303)
    6) install win32_11gR2_client
    Select: Administrator (1.02GB)
    Oracle Base: C:\Oracle
    Software Location: C:\Oracle\product\11.2.0\client_1
    7) Ensure environmental variable ORACLE_HOME is set to C:\Oracle\product\11.2.0\client_1
    8) Ensure tnsnames.ora and sqlnet.ora still exist and are unchanged.
    9) SQL Server Management Studio
    Restart SQL Server
    Add link to Oracle - Successful

    You actually installed the client *3* times there.
    I'm fairly sure install Instant client via win32_11gR2_client will not give you oraoledb. ODAC and administrator/runtime will though.
    You should only need install ODTwithODAC112021 OR win32_11gR2_client (with runtime or administrator option) and be able to connect using SQLServer.
    Greg

  • PeopleTools 8.49 PeopleSoft Database Cannot Connect with MS SQL Server 2005

    Folks,
    Hello. I am working on PeopleSoft PIA. My system is Windows Server 2003, MS SQL Server Express 2005 Standard, PeopleTools 8.49. I am setting up PeopleSoft Database \PsMpDbInstall\setup.exe and got the errors as follows:
    Error: Setup fails to connect to SQL Server. The default settings SQL Server does not allow remote connection.
    Then I type in "sqlcmd" in Command Prompt and got the same error as follows:
    Name Pipe Provider: Could not open a connection to SQL Server. MS SQL Native Client: the default settings SQL Server does not allow remote connection.
    In order to fix SQL Server 2005 remote connection problem, I have done the 3 steps as follows:
    Step 1: In SQL Server Surface Area Connection, enable local and remote connection, TCP/IP and Name Pipes, SQL Server browser Startup type "automatic" and status "running".
    Step 2: Create exception for SQL Server 2005 and SQL Server browser Service in Windows Firewall.
    Step 3: Add the default SQL Server Port 1433 into Windows Firewall.
    But the above 3 steps cannot resolve SQL Server Express 2005 remote connection problem. Can any folks help to resolve this problem ?
    Thanks.

    Folks,
    Management Studio can connect with SQL Server 2005 successfully.
    I have turned off Windows Server 2003 firewall completely. But "sqlcmd" in Command Prompt still connect with SQL Server 2005 because its remote connection is not allowed.
    Is the "not allow remote connection" problem caused by Windows Firewall or SQL Server 2005 itself ?
    Thanks.

  • Equivalent of Materialized Views in SQL Server

    Hi
    we are migrating  Oracle Database to SQL Server 2012 and is looking for solution, equivalent to Materialized Views in Oracle.
    we had tried to implement indexed View, but that was not possible, because the MVs have outer joins, subqueries, aggregate functions and also there is no column in it which can act as a Primary Key.
    Please Help to get a solution for this issue.
    Regards
    Joyasree Mondal

    >use tempdb
    >drop table t
    >go
    >create table t(id int, constraint pk_t primary key (id))
    >
    >go
    >insert into t(id)
    >select top 1000 cast( cast( newid() as binary(4) ) as int)
    >from sys.objects o, sys.columns c
    >go 100
    >
    >
    >select id
    >from t with (index=pk_t, tablockx)
    >
    >
    >select id
    >from t with (index=pk_t, nolock)
    Still the same order.
    >> No, its always in the key order like I've shown here.
    > You are extrapolating from a single example.
    Actually, this information doesn't even come from my exampleS (there were quite a few so far). Its written in the article you posted here. My examples are meant to confirm that and explain why the ORDER BY clause is redundant in some cases.
    > I have.  ORDER BY in a view used to always return ordered results.  Then it didn't.
    Examples? References?
    >GROUP BY without an ORDER BY used to always return ordered results.  Then it didn't.  Many queries have >change the result ordering when you get a parallel plan.
    Now you finally admit ordered results would always be returned, even without an order by clause. We are in the right track it appears. The reason for this change of behavior is a variation in the logical operator used by the query optimizer, and not the
    way the engine reads pages from disk.
    In the beginning of times there was stream aggregate, an operator that would require its input to be sorted. And this is how a GROUP BY clause would ensure results were always ordered.
    But then his ugly cousin came and messed things up. He doesnt need an ordered input so yeah, order would be random. AGAIN, there are still ways of enforcing order here, through query hints, without requiring an order by clause, so this changes nothing.
    You have confirmed that for a given operator, results will always be ordered. Your own argument has, once again, proven my point.
    > Right.  But there are different _kinds_ of scans.  An ordered scan, where SQL Server reads rows based on the logical order of the index is just one kind. 
    It only won't scan in key order (by scheduling reads) if you change the transaction isolation level and hope for the worse. Because the key order scan is the best performing way of reading pages, this behavior (although possible) wasan't even observed in
    the example with NOLOCK/TABLOCK (known to cause allocation-order scans in larger tables) you posted above.
    > Other kinds include the parallel scan, the reverse scan,
    References?
    > the merry-go-round scan,
    Only applies to table scans, not indexes.
    http://technet.microsoft.com/en-us/library/ms191475%28v=SQL.105%29.aspx
    > And the allocation-order (or unordered) scan. 
    Only if you specify TABLOCK or NOLOCK query hints, which I haven't done. This is something that goes without saying, it's irrelevant to an indexed view scenario such as this one.
    Some people have also said it will perform an allocation-order scan if the index is too fragmented in SQL Server 2005, but as of 2012 it (probably) won't, as I have shown here. There is also no document anywhere in the internet (you are free to search for
    it), that would point us otherwise. If you have access to additional information, I would be more than happy if you could share it with us.
    Reference: http://sqlmag.com/database-development/quaere-verum-clustered-index-scans-part-iii
    > And don't take my word for it.  Take Conor Cunningham's:
    >If you need order in your query results, put in an ORDER BY.  It's that simple.  Anything else is like >riding in a car without a seatbelt.
    >No Seatbelt - Expecting Order without ORDER BY
    Again, with all due respect, did you read your own article? Did you read what I said earlier about having multiple I/O threads as a whole other situation? If you add new variables, OF COURSE the results will be different. Parallelism was disabled in the
    server I performed these tests on, but still you can control this by query hints, and you can enforce execution plans by using plan gudes.
    Its like I always say - it's always about the 0.001% of situations, the exceptions, rather than the general rule.
    Tell Mr Connor to add MAXDOP 1 to his querys OPTION clause and see if results are still unordered lol
    References:
    http://msdn.microsoft.com/en-us/library/ms190417.aspx
    http://msdn.microsoft.com/en-us/library/ms181714.aspx
    http://technet.microsoft.com/en-us/library/ms188611%28v=sql.105%29.aspx
    http://blogs.msdn.com/b/conor_cunningham_msft/archive/2008/08/27/no-seatbelt-expecting-order-without-order-by.aspx
    Imagining uncontrollable factors that would get an ordered input to be retrieved in an unordered manner is one of SQL Server's myths. There are a whole other people around who think the same way because of some experiences they had when they didn't know
    how to control the execution plan, and adding an order by clause is a very popular and easy shortcut to a complex problem. "In the worst cases it will just be redundant", they say. What they like to forget is that sorting has an often high cost,
    and it can be avoided by taking advantage of indexes.

  • Execute a procedure with a list of array in sql server 2008

    HI all,
    I have a procedure which has a list of values passed as an array . How can i execute my procedure with array list? how to implement this?Please help me.
    Thanks in advance
    Deepa

    Hi Deepa,
    basically Microsoft SQL Server does not support arrays as data types for procedures. What you can do is creating a type which represents a table definition. This type can than be used in a procedure as the following demo will show:
    The first script creates the environment which will be used for the execution
    -- 1. create the table as a type in the database
    CREATE TYPE OrderItems AS TABLE
    ItemId int PRIMARY KEY CLUSTERED
    GO
    -- 2. demo table for demonstration of results
    CREATE TABLE dbo.CustomerOrders
    Id int NOT NULL IDENTITY (1, 1) PRIMARY KEY CLUSTERED,
    CustomerId int NOT NULL,
    ItemId int
    GO
    -- 3. Insert a few records in demo table
    INSERT INTO dbo.CustomerOrders
    (CustomerId, ItemId)
    VALUES
    (1, 1),
    (2, 1),
    (3, 3),
    (1, 3);
    GO
    -- 4. Create the procedure which accepts the table variable
    CREATE PROC dbo.OrderedItemsList
    @Orders AS OrderItems READONLY
    AS
    SET NOCOUNT ON;
    SELECT o.*
    FROM dbo.CustomerOrders AS O INNER JOIN @Orders AS T_O
    ON (o.ItemId = T_O.ItemId);
    SET NOCOUNT OFF;
    GO
    The above script creates the table data type and a demo table with a few demo data. The procedure will accept the table data type as parameter. Keep in mind that table variable parameters have to be READONLY as parameter for procedures!
    The second script demonstrates the usage of the above scenario
    When the environment has been created the usage is a very simple one as you can see from the next script...
    -- 1. Fill the variable table with item ids
    DECLARE @o AS OrderItems;
    INSERT INTO @o (ItemId)
    VALUES
    (1), (3);
    -- 2. Get the list of customers who bought these items
    EXEC dbo.OrderedItemsList @Orders = @o;
    MCM - SQL Server 2008
    MCSE - SQL Server 2012
    db Berater GmbH
    SQL Server Blog (german only)

  • Linked Servers Diff Domains server type SQL Server vs OLE

    Ok, we have two different servers ETL03 (2012) and SQL03 (2012 ent). Each on Separate domains SQL03 server has many instances. i have kerberos set up and it appears to be working fine (run SELECT auth_scheme FROM sys.dm_exec_connections WHERE session_id
    = @@spid ;).  For the different instances to work with Kerberos, i had to assign a static port to each of the instances.  The main server instances are using the default 1433.  When i created a linked server from SQL03\TestInstance to ETL03,
    i can put the
    Link server: ETL03
    Server Type: SQL Server
    Security 'Be made using the login's current security context'
    If i make this exact same linked server but from ETL03 to SQL03\TestInstance  i get the error Login failed for user 'NT Authority/Anonymous Login'.  
    If i create the connection where the Server Type is OLE DB, it works. However, not all of the databases show up in the catalog.
    So here are my questions:  
    1- anyone have any ideas as to why the OLE DB connection works and the SQL Server connection doesn't work when going from ETL03 to SQL03\TestInstance
    2- If i have to use the OLE DB connection, fine, but where are all of the db's? Most show up, but a few do not.
    FYI, the linked server from ETL03 to default instance of SQL03 works perfectly, i can see all db's etc.  So has something to do with these named instances.  Thanks for all and any input.

    So i figured out what it was looking for, if anyone is interested.  In order to use SQL Server as the type, i had to use the FQDN so when making the connection the server name is, SQL03.subdomain.domain.local\TestInstance.
    This works and you can see all of the db's etc.  I'd still like to know why the other doesn't work. When setting the spns for the service account, i included two entries: 
    MSSQLSvc/SQL03:50001
    MSSQLSvc/SQL03.subdomain.domain.local:50001
    so technically i shouldn't have to use the fqdn, but as long as it works....

  • Does SSIS guarantee that it loads the data into SQL Server in the same order as it is in Excel

    Hi,
    We are trying to load several Excel files into SQL Server SSIS and we need to save the data in the database in the same order as it is in Excel..
    My question is, Does SSIS guarantee that it loads the data into SQL Server in the same order as it is in Excel. If so, we will add a sequence to ensure we have the order.
    Please advise.
    Thanks & Regards,
    Dhanumjay

    Thanks for your response.
    If it is one file then we can add an index column, but we have to load hundreds of files.
    How adding an index/key column to the table works unless SSIS picks and loads the data in the table in the same order as it is in Excel?
    Just to explain my question better,
    If excel has three rows  {a,b},{c,d},{e,f}, does SSIS ensure it loads the data in the same order in a table.
    Thanks.

  • SQL Server JDBC Must read columns in order?

    Is this some kind of sick joke?
    If I use rs.getString() to retrieve columns by name from the data base, they must be retrieved exactly in the order that they appear in the actual database, or else an error will result.
    Someone please tell me that this is not the case.

    Some JDBC drivers make that restriction. Apparently the JDBC specification allows them to do so. So, it's possible that the SQL Server driver does that, and your post implies that it does.

  • Replicating objects in order - SQL Server 2008

    Hi
    I am having trouble replicating objects across one server to another. During the process, a view is being created on the subscription server.  However, this errors out due to a table used in the view not yet being created by replication process.
    Is there any way I can dictate to the replication process to create tables first then views then SPs after?
    Thanks in advance.

    Replication is supposed to order objects according to their DRI. You need to ensure that the views and stored procedures reference objects which are included in your publication, and if you have multiple publications you need to ensure that all referenced
    objects are in the same publication.
    Another option is to publish the views and also the stored procedures in different publications.
    You also may want to publish the views in a post snapshot script.
    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

  • Reporting Services 2012 for SharePoint and SQL Server Agent "Subscriptions and Alerts"

    After installing Reporting Services for SharePoint (Denali) in my test farm, I'm trying to configure the "SQL Server Agent" access for Reporting Services.  From Central Admin I'm going to the Reporting Service applicaiton configuration screen and selecting
    "Provision Subscriptions and Alerts".  I've tried both options on this screen.  I've manually executed the "download sql script" in SQL Server, as well as entering a user with SQL sys admin rights on the SQL server into the login fields on the screen. 
    The role and permissions have been created for the application pool service account, but Reporting Services is still trying to connect with the annonymous login because I'm getting the following alert each time I open the "Provision Subscriptions and Alerts"
    screen:
    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
    The "status" on the screen still shows "SQL Server Agent State cannot be determined".  Has anyone else seen this? 
    Thanks!!

    Thanks for your reply!
    1) Looks like the new Reporting Services does not run as a Windows Service so it's not listed in the "Configure Service Accounts" pulldown.  As a result, I don't see how to set the service account.  It's only assigned to an application pool. 
    I installed it into an existing application pool and that application pool "is" in the list and has a domain service account already assigned.
    2) Which users need to be in here in order to configure the "Provision Subscriptions and Alerts" screen?  I already have the farm admin account which is the account I use when running Central Admin.
    3) As mentioned in #1, I've installed Reporting Services into an existing application pool with other service apps.
    4) This link is for Reporting Services 2008 R2 which is very different install process.  But I did follow the SQL Server Reporting Services 2012 RC0 installation instructions and the Reporting Services is functioning correctly with no errors. 
    I'm just not able to configure the sceduling the alerting with interfaces with the SQL Server Agent.
    Thanks!

  • Can not see all the SQL server views

    My SQL Server 2005 (SP2 STD)  has about 1000 views. When I created a Crystal Report using Crystal Report 10, I can only see about 225 views are listed in Database Expert. Here is the procedure to reproduce the problem:
    1. Create a new Crystal Report
    2. Create a new connection using ODBC RDO
    3. Drill into DSN Name->DB Name->dbo->Views. Only the first 200 or so views in alphabetical order are listed on Available Data Sources on the left pane.
    I am using SQL authentication and sa account to connect to SQL. So security should not be the problem. I can also use Access 2003 linked table to see all the views in my SQL server.
    Is there a restriction on how many views can be listed in Crystal Data Source? Is there another way to add data source to Report without using Database Expert?
    Thanks in advance!

    Youdao,
    There is a default limit of 8000 objects that Crystal will see in the database.
    I would suggest right clicking on your datasource and selecting Options. In the Data Explorer uncheck Tables and Stored Procedures leaving Views selected > press OK > then right click again and refresh.
    If the limit was being reached then you should now see at least more Views if not all.
    The default limit can be edited in the Registry (*Always recommended to back up the registry before editing).
    The key is HKEY_CURRENT_USER > Software > Crystal Decisions or Business Objects > (version number) > Crystal Reports > Fetch options > NTablesMax

  • Unable to install SQL server 2012 on windows 7 64bit

    Overall summary:
    Final result: Failed: see details below
    Exit code (Decimal): -2057043966
    Exit facility code: 1380
    Exit error code: 2
    Exit message: There was a failure to calculate the applicability of setting ALLINSTANCES.
    Start time: 2015-03-17 21:43:13
    End time: 2015-03-17 21:43:34
    Requested action: LandingPage
    Exception help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.2100.60&EvtType=0x4F2D2386%400xE9BC3D64&EvtType=0x4F2D2386%400xE9BC3D64
    Machine Properties:
    Machine name: ELKR-1214-1745
    Machine processor count: 4
    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
    Package properties:
    Description: Microsoft SQL Server 2012
    ProductName: SQL Server 2012
    Type: RTM
    Version: 11
    SPLevel: 0
    Installation location: c:\afaeb7739e47ceedb4b5f79a1e14a784\x64\setup\
    Installation edition:
    User Input Settings:
    ACTION: LandingPage
    CONFIGURATIONFILE:
    ENU: true
    HELP: false
    INDICATEPROGRESS: false
    QUIET: false
    QUIETSIMPLE: false
    UIMODE: AutoAdvance
    X86: false
    Configuration file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20150317_214254\ConfigurationFile.ini
    Rules with failures:
    Global rules:
    There are no scenario-specific rules.
    Rules report file: The rule result report file is not available.
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: Microsoft.SqlServer.Chainer.Infrastructure.CalculateSettingApplicabilityException
    Message:
    There was a failure to calculate the applicability of setting ALLINSTANCES.
    HResult : 0x85640002
    FacilityCode : 1380 (564)
    ErrorCode : 2 (0002)
    Data:
    SettingId = ALLINSTANCES
    WatsonData = Microsoft.SqlServer.Chainer.Infrastructure.CalculateSettingApplicabilityException@2
    HelpLink.EvtType = 0x4F2D2386@0xE9BC3D64
    DisableWatson = true
    Stack:
    at Microsoft.SqlServer.Chainer.Infrastructure.Setting.CalculateApplicability()
    at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.CalculateAllSettings(Boolean chainerSettingOnly)
    at Microsoft.SqlServer.Configuration.SetupExtension.FinalCalculateSettingsAction.ExecuteAction(String actionId)
    at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
    at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun, ServiceContainer context)
    Inner exception type: Microsoft.SqlServer.Chainer.Infrastructure.CalculateSettingChangeabilityException
    Message:
    There was a failure to calculate the changeability of setting ALLINSTANCES.
    HResult : 0x85640003
    FacilityCode : 1380 (564)
    ErrorCode : 3 (0003)
    Data:
    SettingId = ALLINSTANCES
    WatsonData = Microsoft.SqlServer.Chainer.Infrastructure.CalculateSettingChangeabilityException@3
    Stack:
    at Microsoft.SqlServer.Chainer.Infrastructure.Setting.CalculateChangeabilityByUser()
    at Microsoft.SqlServer.Deployment.PrioritizedPublishing.PublishingQueue.CallQueuedSubscriberDelegates()
    at Microsoft.SqlServer.Deployment.PrioritizedPublishing.PublishingQueue.Publish(Publisher publisher)
    at Microsoft.SqlServer.Chainer.Infrastructure.Setting.CalculateApplicability()
    Inner exception type: Microsoft.SqlServer.Chainer.Infrastructure.UnableRetrieveConfigObjectForSettingException
    Message:
    Unable to retrieve a public configuration object type Microsoft.SqlServer.Configuration.SetupExtension.SlpInputSettings for setting ALLINSTANCES.
    HResult : 0x85640007
    FacilityCode : 1380 (564)
    ErrorCode : 7 (0007)
    Data:
    SettingId = ALLINSTANCES
    ConfigObjectType = Microsoft.SqlServer.Configuration.SetupExtension.SlpInputSettings
    WatsonData = Microsoft.SqlServer.Chainer.Infrastructure.UnableRetrieveConfigObjectForSettingException@7
    Stack:
    at Microsoft.SqlServer.Chainer.Infrastructure.SettingBridge.GetHostingObject()
    at Microsoft.SqlServer.Chainer.Infrastructure.SettingBridge.ChangeabilityByUser()
    at Microsoft.SqlServer.Deployment.PrioritizedPublishing.PublishingQueue.CallFunctionWhileAutosubscribing[T](SubscriberDelegate subscriberDelegate, Int32 priority, AutosubscribingFunctionDelegate`1 function)
    at Microsoft.SqlServer.Chainer.Infrastructure.Setting.CalculateChangeabilityByUser()
    Inner exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
    Message:
    Unable to generate a temporary class (result=1).
    error CS0009: Metadata file 'c:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll' could not be opened -- 'File is corrupt'
    HResult : 0x84b10001
    FacilityCode : 1201 (4b1)
    ErrorCode : 1 (0001)
    Stack:
    at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.DeserializeObject(String rootPath, Type type, String elementXPath)
    at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.DeserializeObject(String rootPath, Type type)
    at Microsoft.SqlServer.Chainer.Infrastructure.SettingBridge.GetHostingObject()
    Inner exception type: System.InvalidOperationException
    Message:
    Unable to generate a temporary class (result=1).
    error CS0009: Metadata file 'c:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll' could not be opened -- 'File is corrupt'
    Stack:
    at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
    at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
    at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
    at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
    at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
    at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.DeserializeObject(String rootPath, Type type, String elementXPath)

    Hi,
    I would like to add that if you see summary.txt file you would see
    Message:
    Unable to generate a temporary class (result=1).
    error CS0009: Metadata file 'c:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll' could not be opened -- 'File is corrupt'
    HResult : 0x84b10001
    FacilityCode : 1201 (4b1)
    ErrorCode : 1 (0001)
    You can see file is corrupt. So either you have to download the setup file again or there can be chance that Antivirus caused some issue.
    Plus if you see starting of summary.txt you could see
    Requested action: LandingPage
    The error message came while landing page was being loaded/or was in action so again I think it is some thing related to corrupt media or antivirus.
    Please
    1. Download ISO file again and extract using WINRAR, don't use Winzip
    2. Disable Antivirus.
    3. Make a new folder and extract installable there.
    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

  • Unable to install sql server express 2014 in windows 8.1 pro

    The program terminates with:
    "Unable to retrieve data for this operation" 
    the logs all end with:
    Attempting to launch process C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\SQLServer2014\setup.exe 
    the bootstrap log references  exception:
    "Microsoft.SqlServer.Configuration.SetupExtension.RunDiscoveryAction" threw an exception during execution.
    (01) 2015-04-02 08:45:15 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: Failed to retrieve data for this request. ---> Microsoft.SqlServer.Management.Sdk.Sfc.EnumeratorException: Failed to retrieve data for this request. --->
    Microsoft.SqlServer.Configuration.Sco.ScoException: Attempted to perform an unauthorized operation. ---> System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
    (01) 2015-04-02 08:45:15 Slp:    at Microsoft.SqlServer.Configuration.Sco.InternalRegistryKey.OpenSubKey(String subkey, RegistryAccess requestedAccess)
    Can you help?

    Just in case, here is a log when running as administrator:
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2146233088
      Exit facility code:            19
      Exit error code:               5376
      Exit message:                  Failed to retrieve data for this request.
      Start time:                    2015-04-03 12:17:20
      End time:                      2015-04-03 12:17:37
      Requested action:              Install
      Exception help link:          
    http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0x48BB60BC%400xBB814387&EvtType=0x48BB60BC%400xBB814387
    Machine Properties:
      Machine name:                  DGF-PAVILION
      Machine processor count:       4
      OS version:                    Windows 8
      OS service pack:              
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Package properties:
      Description:                   Microsoft SQL Server 2014
      ProductName:                   SQL Server 2014
      Type:                          RTM
      Version:                       12
      SPLevel:                       0
      Installation location:         C:\0\SQLServer Developer\x64\setup\
      Installation edition:          Evaluation
    Product Update Status:
      None discovered.
    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      false
      AGTSVCACCOUNT:                 <empty>
      AGTSVCPASSWORD:                <empty>
      AGTSVCSTARTUPTYPE:             Manual
      ASBACKUPDIR:                   Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   Config
      ASDATADIR:                     Data
      ASLOGDIR:                      Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:                  <empty>
      ASSVCPASSWORD:                 <empty>
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            <empty>
      ASTEMPDIR:                     Temp
      BROWSERSVCSTARTUPTYPE:         Disabled
      CLTCTLRNAME:                   <empty>
      CLTRESULTDIR:                  <empty>
      CLTSTARTUPTYPE:                0
      CLTSVCACCOUNT:                 <empty>
      CLTSVCPASSWORD:                <empty>
      CLTWORKINGDIR:                 <empty>
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:            
      CTLRSTARTUPTYPE:               0
      CTLRSVCACCOUNT:                <empty>
      CTLRSVCPASSWORD:               <empty>
      CTLRUSERS:                     <empty>
      ENABLERANU:                    false
      ENU:                           true
      ERRORREPORTING:                false
      FEATURES:                     
      FILESTREAMLEVEL:               0
      FILESTREAMSHARENAME:           <empty>
      FTSVCACCOUNT:                  <empty>
      FTSVCPASSWORD:                 <empty>
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  false
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    <empty>
      INSTANCENAME:                  <empty>
      ISSVCACCOUNT:                  NT AUTHORITY\Network Service
      ISSVCPASSWORD:                 <empty>
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:            <empty>
      MATRIXNAME:                    <empty>
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      ROLE:                         
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              DefaultSharePointMode
      RSSVCACCOUNT:                  <empty>
      RSSVCPASSWORD:                 <empty>
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         <empty>
      SECURITYMODE:                  <empty>
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
      SQLSVCACCOUNT:                 <empty>
      SQLSVCPASSWORD:                <empty>
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           <empty>
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  false
      TCPENABLED:                    0
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      USEMICROSOFTUPDATE:            false
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150403_121719\ConfigurationFile.ini
    Rules with failures:
    Global rules:
    Scenario specific rules:
    Rules report file:               The rule result report file is not available.
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: Microsoft.SqlServer.Management.Sdk.Sfc.EnumeratorException
        Message:
            Failed to retrieve data for this request.
        HResult : 0x80131500
        Data:
          HelpLink.ProdName = Microsoft SQL Server
          HelpLink.BaseHelpUrl =
    http://go.microsoft.com/fwlink
          HelpLink.LinkId = 20476
          HelpLink.EvtType =
    0x48BB60BC@0xBB814387
          DisableWatson = true
        Stack:
            at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.ProcessDTbl(DataTable dt, Int32 level)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.ProcessDTbl(DataTable dt, Int32 level)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.CollectSqlDiscoveryData(String machineName)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.CollectDiscoveryData(String machineName)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.LoadData(IEnumerable`1 machineNames, String discoveryDocRootPath, String clusterDiscoveryDocRootPath)
            at Microsoft.SqlServer.Configuration.SetupExtension.RunDiscoveryAction.ExecuteAction(String actionId)
            at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.<>c__DisplayClasse.<ExecuteActionWithRetryHelper>b__b()
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(ActionWorker workerDelegate)
        Inner exception type: Microsoft.SqlServer.Configuration.Sco.ScoException
            Message:
                    Attempted to perform an unauthorized operation.
            HResult : 0x84bb0001
                    FacilityCode : 1211 (4bb)
                    ErrorCode : 1 (0001)
            Data:
              WatsonData =
    HKEY_LOCAL_MACHINE@SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.TRAJECTORY2014\Setup
            Stack:
                    at Microsoft.SqlServer.Configuration.Sco.InternalRegistryKey.OpenSubKey(String subkey, RegistryAccess requestedAccess)
                    at Microsoft.SqlServer.Configuration.Sco.SqlRegistryKey.OpenSubKey(String subkey, RegistryAccess requestedAccess)
                    at Microsoft.SqlServer.Discovery.DiscoveryUtils.GetLocalMachineSubKey(ServiceContainer ctx, String machineName, RegistryView regView, String regPath, RegistryAccess registryAccess)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.GetInstanceMapObject(String machineName, RegistryView registryView, String instanceId, String instanceName, String
    instanceType, String instanceSuffix, UpgradedInstanceStateEnum instanceState)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.GetInstanceMapCollectionInHive(String machineName, RegistryView regView, List`1 subKeys)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.GetInstanceMapCollection()
                    at Microsoft.SqlServer.Discovery.Instance.GetData(EnumResult erParent)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData()
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request req, Object ci)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
            Inner exception type: System.UnauthorizedAccessException
                Message:
                            Attempted to perform an unauthorized operation.
                HResult : 0x80070005
                Stack:
                            at Microsoft.SqlServer.Configuration.Sco.InternalRegistryKey.OpenSubKey(String subkey, RegistryAccess requestedAccess)

  • Unable to install SQL Server Express 2008 R2 - Errors "Failed to retrieve data for this request"

    As domain admin I am attempting to install "SQL Server 2008 R2 with SP2" but it keeps failing with "Failed to retrieve data for this request".
    The installation never actually starts, it errors before then.
    It displays the same error even if I run the System Configuration Checker.
    The summary.txt for the install displays the following text:
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -1554760125
      Exit facility code:            852
      Exit error code:               15939
      Exit message:                  Failed to retrieve data for this request.
      Start time:                    2014-08-15 16:49:52
      End time:                      2014-08-15 16:50:06
      Requested action:              RunRules
    Machine Properties:
      Machine name:                  servername
      Machine processor count:       8
      OS version:                    Windows Server 2008 R2
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  Yes
    Product features discovered:
      Product              Instance             Instance ID                   
    Feature                                  Language            
    Edition              Version         Clustered
    Package properties:
      Description:                   SQL Server Database Services 2008 R2
      ProductName:                   SQL Server 2008 R2
      Type:                          RTM
      Version:                       10
      SPLevel:                       1
      Installation location:         c:\84122ef5b6d9cdcd3b2ac48cec\x64\setup\
      Installation edition:          EXPRESS
    User Input Settings:
      ACTION:                        RunRules
      CONFIGURATIONFILE:             
      ENU:                           True
      FARMACCOUNT:                   <empty>
      FARMADMINPORT:                 0
      FARMPASSWORD:                  *****
      FEATURES:                      
      HELP:                          False
      INDICATEPROGRESS:              False
      INSTANCENAME:                  <empty>
      PASSPHRASE:                    *****
      QUIET:                         False
      QUIETSIMPLE:                   False
      RULES:                         GLOBALRULES,SqlUnsupportedProductBlocker,PerfMonCounterNotCorruptedCheck,Bids2008InstalledCheck,BlockInstallSxS,AclPermissionsFacet,FacetDomainControllerCheck,SSMS_IsInternetConnected,FacetWOW64PlatformCheck,FacetPowerShellCheck
      UIMODE:                        AutoAdvance
      X86:                           False
      Configuration file:            C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20140815_164944\ConfigurationFile.ini
    Detailed results:
    Rules with failures:
    Global rules:
    There are no scenario-specific rules.
    Rules report file:               The rule result report file is not available.
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: Microsoft.SqlServer.Management.Sdk.Sfc.EnumeratorException
        Message:
            Failed to retrieve data for this request.
        Data:
          HelpLink.ProdName = Microsoft SQL Server
          HelpLink.BaseHelpUrl = http://go.microsoft.com/fwlink
          HelpLink.LinkId = 20476
          DisableWatson = true
        Stack:
            at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.ProcessDTbl(DataTable dt, Int32 level)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.CollectSqlDiscoveryData(String machineName)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.LoadData(IEnumerable`1 machineNames, String discoveryDocRootPath, String clusterDiscoveryDocRootPath)
            at Microsoft.SqlServer.Configuration.SetupExtension.RunDiscoveryAction.ExecuteAction(String actionId)
            at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun)
        Inner exception type: Microsoft.SqlServer.Configuration.Sco.SqlRegistryException
            Message:
                    The network path was not found.
            Data:
              WatsonData = [email protected]rror
            Stack:
                    at Microsoft.SqlServer.Configuration.Sco.SqlRegistry.CreateBaseKey(ServiceContainer ctx, String machineName, IntPtr hKey, String keyName, RegistryAccess access, RegistryView
    view)
                    at Microsoft.SqlServer.Configuration.Sco.SqlRegistry.GetLocalMachine(ServiceContainer ctx, String machineName, RegistryAccess access, RegistryView view)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.GetSql2kMsiInstanceListInHive(String machineName, RegistryView regView)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.LoadSql2kInstanceList(String machineName)
                    at Microsoft.SqlServer.Discovery.Product.GetData(EnumResult erParent)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData()
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)

        Inner exception type: Microsoft.SqlServer.Configuration.Sco.SqlRegistryException
            Message:
                    The network path was not found.
            Data:
              WatsonData = [email protected]rror
    Above message says that your registry is not consistent and some of the parameters are missing from registry.Or
    Account installing SQL server does not have permission to access this. I think case can be here that account with which you logged into your system to install SQL Server might not have certain privileges. Can you take help
    of domain admin account add it as a local administrator in this machine always right click on setup file and select run as administrator. Before this make sure you  remove all SQL Server components from add remove program
    I strongly recommend you to have a good look at below thread
    http://support.microsoft.com/kb/2000257/en-us
    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

  • Migration via wireless network

    The migration assistant on the iMac I'm trying to migrate from (B) recognises the MacBook I'm trying to migrate to (A) but when I input the passcode from A into B it spends ages "searching for other computers" and then eventually gives me the boxes f

  • How to make changes on Web Dynpro iView.

    Dear all We are using EP 7.0. Now I need to upload two documents to be accessed with link from a portal iView for HR documents, which was created using Web Dynpro. As I am new to Web dynpro, can any body help me to make these changes. I have already

  • How to call WEB Service From SAP 4.6 c

    Hi Friend, How to call WEB Service From SAP 4.6 c Report Thanks in advance.

  • Can I upgrade Elements 12 to download movies?

    My Elements 12 won't download movies; will the premier version do it?  And can I upgrade to it?  Cost?

  • Itunes and Server 2003

    Hi. I am running Windows Server 2003 on My Dell Laptop and am unable to install iTunes or Quicktime. I was told it was a problem with Quicktime and a conflict between windows security settins and quicktimes security settings. When I try to install iT