Partitioned view read other tables when it shouldn't? SQL Server 2008 bug?

The query still scans all the tables where it supposes to scan only one table when the tables have more than, say, 10000 rows. 
The details can be found here.
http://stackoverflow.com/questions/25691738/unreliable-partitioned-view-execution-table-scan-sql-server-bug?noredirect=1#comment40155612_25691738

I don't see why this would be a bug.
The optimizer has no information about what is in this table variable, since table variable does not have statistics. Therefore it comes up with a plan which makes sense in the general case, that is, the table variable has data from both partitions. If that
plan is such that a startup expression can be applied, a startup filter is added. But in the case where both tables are scanned, the optimizer has decided that the best is to run a MERGE JOIN on the two tables.
The situation may brighten up a bit, if you instead use a temp table, since a temp table has distribution statistics.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

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

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

    http://msdn.microsoft.com/en-us/library/ms186858.aspx
    Permissions
    If the database being restored does not exist, the user must have CREATE DATABASE permissions to be able to execute RESTORE. If the database exists, RESTORE permissions default to members of the sysadmin and dbcreator fixed
    server roles and the owner (dbo) of the database (for the FROM DATABASE_SNAPSHOT option, the database always exists).
    RESTORE permissions are given to roles in which membership information is always readily available to the server. Because fixed database role membership can be checked only when the database is accessible and undamaged, which is not always the case when RESTORE
    is executed, members of the db_ownerfixed database role do not have RESTORE permissions.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Can not read Chinese data when DB Connect to SQL server 2000

    Hi,
       Our BW server( BW3.5 not unicode ) is installed on MS SQL server 2000. We try to connect the BW SQL server with db connect function. We create some test views in the Northwind DB. We are be able to access data from source system in rsa1 by db connect. The problem is that all the Chinese characters are displayed as ?????. Is there any special setting for accessing multibyte characters in MS SQL server 2000? Please advise.
    Thank you,
    Jeff

    The field of VIEW in the sqlserver which code is chinese must be the nvarchar.
    You can try it.

  • Error Code 1605 when installing or unstalling sql server 2008 R2 on my server

    Rai, Sunil (IN - Delhi)
    5:32 PM
    TITLE: SQL Server Setup failure.
    SQL Server Setup has encountered the following error:
    MsiGetProductInfo failed to retrieve ProductVersion for package with Product Code = '{2453DBC8-ACC4-4711-BD03-0C15353AA3D8}'. Error code: 1605..
    BUTTONS:
    OK

    With limited information you posted I can only find below
    http://www.windowsvalley.com/fix-sql-server-setup-has-encountered-the-error-code-1605/
    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

  • Error when i want install sql server 2008

    Hi,
    I want the below error:

    What's operation system? What's edition of SQL Server? Have you opened ISO file and run setup.exe locally?
    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

  • When i am installing sql server 2008 R2 th e following error is occur please tell me the solution

    this is the error message picture.
    http://social.msdn.microsoft.com/Forums/getfile/421145

    >>http://social.msdn.microsoft.com/Forums/getfile/421145
    this is the image link see the image pleaseee
    We are not able to see the image. Please use the image button to insert the image to the post 
    Or tell us what is the error message.
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Error when installing SQL Server 2008 R2 after downloading

    Hi -I hope somebody  can help me.
    I have tried to install nopCommerce with no luck. I am not able to establish the SQL database. I have tried to solve the problem for a very long time, also with no luck. Now I think it has to do with an error that come when I installed the SQL Server 2008
    R2.
    I have tried to load a picture here, but was denied.
    with hopes for help
    Regards Egil Ryengen
    The error text is as followed:
    Unhandled exception has occured in your application. If you click Continue, the application will ignore this error and attempt to continue. You click Quit, the application will close immediately.
    An error occurred creating the configuration section handler for  userSettings/Microsoft.SqlServer/Configuration/LandingPage/Properties.Settings: not load file or assambly "System, Version =4.0.0.0,
    Culture=neutral. Public Key Token=b77a5c561934e089" or one of its dependencies. The system cannot find the file specified. 
    (C:/Users/EgilRyengen/AppData/Local/Microsoft_Corporation/LandingPage.exe_StrongName_ryspccglaxmt4nhllj5z3thycltsvyyx/10.0.0.0/user.co

    Unhandled exception has occured in your application. If you click Continue, the application will ignore this error and attempt to continue. You click Quit, the application will close immediately.
    An error occurred creating the configuration section handler for  userSettings/Microsoft.SqlServer/Configuration/LandingPage/Properties.Settings: not load file or assambly "System, Version =4.0.0.0,
    Culture=neutral. Public Key Token=b77a5c561934e089" or one of its dependencies. The system cannot find the file specified. 
    (C:/Users/EgilRyengen/AppData/Local/Microsoft_Corporation/LandingPage.exe_StrongName_ryspccglaxmt4nhllj5z3thycltsvyyx/10.0.0.0/user.co
    Did you read hardware and software requirements before installing SQL Server 2008 R2. I guess you are missing .Net framework. AS per
    This Doc
    You need to download and install .Net framework 3.5 SP1 and requirement is more if you are installing express edition. Its all mentioned in link
    You can also refer to
    this Thread it has same issue as you are having
    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

  • How to hide system tables when using the Oracle SQL Developer?

    Hi,
    I would like to know how can I show only the tables that I created under the Tables tree? I didnt find a way to create a separate database using the Oracle Sql Developer. I see all the tables together, and would like to differentiate between different databases.
    Can anyone explain to me how to do these things?
    Thanks,

    Hi,
    I would like to know how can I show only the tables that I created under the Tables tree? Your posting is not clear,again tell something more on tables tree,what u want to achieve with it.
    How to hide system tables when using the Oracle SQL Developer? if u connected with sys, system or user with dba role then u have a privilege to see these tables,so revoke the privilege/role from ur user to view this tables if ur connected other then sys,system,
    I didnt find a way to create a separate database using the Oracle Sql Developer. DBCA is a tool for creating the new database.
    Kuljeet

  • Unhandled SOAP Exception When Reading from an External List created from SQL Server

    This is absolutely doing my head it.  Doesn't matter what I do, which approach I take or how its done, I gt the same crappy error from Sharepoint Designer 2010.
    Pulling Data from SQL Server 2008 using An external List.  All I want to do is read the data and display in on the Sharepoint Site..  Nothing fancy, just read.
    Created a Limit filter to limit 100 records per time, removed any primary keys, get no warnings or Errors upon creating the External List or View.  
    But when I add it to the view or data source in page designer, I get the unhandled exception error we all know and love :-(...  
    Anybody shed any light on this before I make a dell 2900 Server sized hole in my window?
    Sharepoint Foundation 2010
    Sharepoint Designer 2010
    SQL Server 2008
    Ta

    Hi,
    If want to change the WCF client (BCS in this case) timeout, you need to change the registry on the SharePoint server.
    The keys are located under:
    HKEY_CURRENT_USER\Software\Policies\Microsoft\office\15.0\Common\Business Data.
    Moreinformation:
    http://blogs.technet.com/b/meamcs/archive/2010/12/23/configuring-wcf-connection-timeout-for-bcs.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Error when insert data in Sql Server table(DateTime data type)

    Hello all,
    I have created a database link in oracle 11g to SQL Server 2008 using Sqlserver gateway for oracle,Oracle run on Linux and SQL Server run on Windows platform.
    I have queried a table and it fetches rows from the target table.
    I am using this syntax for insert a row in Sql Server table.
    Insert into Prod@sqlserver (NUMITEMCODE, NUMPREOPENSTOCK, NUMQNTY, NUMNEWOPENSTOCK, DATPRODDATE , TXTCOMPANYCODE, "bolstatus", NUMRESQNTY )
    Values (1118 , 1390.0 , 100.0 ,1490 , '2012-06-23 12:37:58.000','SFP' ,0 , 0 );
    but it give me error on DATPRODDATE,The data type of DATPRODDATE column in Sql Server is DATETIME.
    My Question is how can i pass the date values in INSERT statement for Sql Server DateTime data type.
    Regards

    Just as with Oracle, you have to specify the date using the to_date() function or use the native date format for the target database (if you can figure out what that is). This is good practice anyway and a good habit to get into.

  • IS there a way to view all the queries executed against a table in sql server 2008 R2

    Hi,
    We would like  to see if a table is getting updated or deleted from external source. Hence we want to know how to see list of queries run against a particular table in sql server 2008 R2.
    Thanks,
    Preetha

    Hi,
    We would like  to see if a table is getting updated or deleted from external source. Hence we want to know how to see list of queries run against a particular table in sql server 2008 R2.
    Thanks,
    Preetha
    Audit, Trigger and custom profiler can be used.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • "Value cannot be null" error when trying to edit or create Maintenance Plan in SQL Server 2008

    I have SQL Server 2008 installed on Windows Server 2008 64bit, every time I try to open or create a new Maintenance Plan I receive the error:
    Value cannot be null.
    Parameter name: component (System.Design)
    Program Location:
       at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.GetDesigner(IComponent component)
       at Microsoft.DataTransformationServices.VsIntegration.DtsDesignerService.OpenDesigner(String connectionString, Object connection, String objectUrn)
       at Microsoft.SqlServer.Management.DatabaseMaintenance.MaintDesignerMenuHandler.Invoke()
    And in the Design view screen
    "Microsoft SQL Server Management Studio is unable to load this document: Could not load type 'Microsoft.SqlServer.Dts.runtime.Wrapper.IDTSPackageSigning100' from assembly 'Microsoft.SqlServer.DTSRunTimeWrap, Version=10.0.0.0, Culture=neutral'. 
    I have searched for a possible solution and have tried some suggestions of registering the msxml6.dll but and have installed VS2008 SP1 but I'm not in a position where I can do a full reinstall of SQL Server right now. Any help is appreciated. My SQL server
    environment information is below. 
    Microsoft SQL Server Management Studio
    10.0.1600.22 ((SQL_PreRelease).080709-1414 )
    Microsoft Analysis Services Client Tools
    2007.0100.1600.022 ((SQL_PreRelease).080709-1414 )
    Microsoft Data Access Components (MDAC)
    6.0.6002.18005 (lh_sp2rtm.090410-1830)
    Microsoft MSXML 3.0 4.0 5.0 6.0 
    Microsoft Internet Explorer 8.0.6001.18943
    Microsoft .NET Framework 2.0.50727.4206
    Operating System 6.0.6002

    I digged a little deeper and figured out it was a missing directory/file in %TEMP%. Seems some CleaningTool removes all files/directories in %Temp% and after that SSMS was not working any longer. The missing file is actually not needed, but the
    missing directory causes the "Value cannot be null" error.
    My missing file name was:
    C:\Users\<username>\AppData\Local\Temp\2\6vvdaozf.tmp
    But the file name changes on every startup.
    So my missing directory name was:
    C:\Users\<username>\AppData\Local\Temp\2
    After creating a empty directory with the name "2" in %TEMP% all went back to work fine for me.
    I'm not sure the directory name is every time the same, but you can discover your missing file with the process monitor from Sysinternal Tools and filters to "Process Name is ssms.exe" and "Path contains AppData\Local\Temp"
    Hope this helps other people to solve their issues too.
    Thank you!! When I run %temp% it takes me to "C:\Users\Admin ...~\AppData\Local\Temp\some random number". At first the random number was 3, after I logged off and back on it was 2. My temp variable in enviromental variables is correct. I looked on another machine
    running SQL2008 and temp is correct there. If I try to rename the numbered folder SSMS stops working. Any idea?

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

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

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

  • Replication of table from Oracle 10g to sql server 2000

    Could i replicate table from Oracle 10g to sql server online. we have tables with same configuration and if any change happen in oracle 10g or sql server in that table we need to replicate that change to other database.
    What is the solution for this two way replication between sql server and Oracle 10g

    But the tutorial is saying that i will have to install Oracle database on the server already having sql server, is it client or whole database, if it is then it will acquire lot of resource.
    I want to find out that for Heterogenous Service ODBC, we need third party software for ODBC Driver of SQL SERVER for Linux and secondly if we use Transparent Gateway then what are the steps for its configuration.
    I could not find steps of configuration of Transoparent gateway, when i am trying to install Transparent gateway from Universal installer, it is not there. where do i find it , Do i need to purchase it too.

  • MS SQL server 2008 - Bulk copy from XML to DB table throws bcp_init error

    I have MS SQL server 2008 installed ,
    Windows version - Windows 7 Professional with SP1
    Doing a bulk copy process using the SQL library function bcp_init function in c++ throws xml error and its not inserting the data into the tables.
    Error received ,
    XML Datatransfer error: XML data or another error occurred while reading file 'd:\temp\scripts\dbtoolscripts\table_data.xml':
    But this works in others machines with the same windows version and SQL version.

    We are using the same SQL lib function bcp_init , we have written a separate class to load the ODBC32.dll , sqlncli.dll  and use the  bcp_init and other SQL functions from that. As i mentioned earlier we all use the same application build , but
    its not working in my machine only other machines its working.
    There is no provision to load XML files when you use the BCP interface in sqlncli.dll. You can of course load XML files, but the BCP API does not know that it is XML, it only sees a number of bytes.
    So that error message is not coming from the BCP API, but somewhere else. Maybe your own code in reaction to some error from the BCP API. But without any clue of that error message, we can't help you.
    I think you will need to do some debugging or by some other means improve your diagnostics.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • How to restore iTunes library from TimeMachine external hard drive backup after clean install

    I was not able to solve this problem, hence I decided to open this discussion. 1. Recently, I clean installed Yosemite so my new Mac is completely empty. 2. I have my time machine backup on my eternal hard drive and would like to restore only specifi

  • Can XML for to Update Fields in PDF be sent to PostScript Form?

    Looking for a VERY hi-speed VERY hi-volume means of printing very large numbers of the Same report, but with different data for 1000s of different users. Thinking that as PDF and Postscript are both Adobe products: a) there may be a high speed means

  • CD burn error in Finder and iTunes:

    MATSHITA DVD-R   UJ-875 "The attempt to burn a disc failed.  The disc drive didn't respond properly and can't recover or retry" Has there been any new resolutions to this issue?  many thanks, burlmac

  • WRONG PLANT GENERATED WITH MATERIAL DOCUMENT IN HU02

    Hi All, I am packing Handling unit with HU02 with following options. Supplying plant 4140 Storage loc 2000(FG) to 2100(HU) with Batch number 11. After Saving this HU, when i check Material Document in Migo generated for above Handling unit, it shows

  • How to write self join in sql?

    Hi, I have table named "table_upload", column "record_type" value "01,03,04....." and start_date,end_date and so on And i will have value for  start_date,end_date only for record_type=01,rest of type these two columns will be null. now i need to writ