Sql server partition parent table and reference not partition child table

 
Hi,
I have two tables in SQL Server 2008 R2, Parent and Child Table.  
Parent has date time, and it is partitioned monthly,  there is a Child table which just refer the Parent table using Foreign key relation.   
is there any problem the non-partitioned child table referring to a partitioned parent table?
Thanks,
Areef

The tables will need to be offline for the operation. "Offline" here, means that you wrap the entire operation in a transaction. Ideally, this transaction would:
1) Drop the foreign key.
2) Use ALTER TABLE SWITCH to drop the old data.
3) Use ALTER PARTITION FUNCTION to drop the old empty partition.
4) Use ALTER PARTITION FUNCTION to add a new empty partition.
5) Reapply the foreign keys WITH CHECK.
All but the last operation are metadata-only operation (provided that you do them right). To perform the last operation, SQL Server must scan the child tbale and verify that all keys are present in the parent table. This can take some time for larger tables.
During the transaction, SQL Server holds Sch-M locks on the table, which means that are entirely inaccessible, even for queries running with NOLOCK.
You avoid this the scan by applying the fkey constraint WITH NOCHECK, but this can have impact on query plans, as SQL Server will not consider the constraint as trusted.
An alternative which should not be entirely dismissed is to use partitioned
views instead. With partitioned views, the foreign keys are not an issue, because each partition is a pair of tables, with its own local fkey.
As for the second question: it appears to be completely pointless to partition the parent, but not the child table. Or does the child table only have rows for a smaller set of the rows in the parent?
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Is Distributed Transaction Coordinator services of the application role are required by SQL Server 2012 for clustering and support of SharePoint 2013.

    All I want to know is if Distributed Transaction Coordinator services of the application role are required by SQL Server 2012 for clustering and support of SharePoint 2013.
    I have been planning and deploying my companies first Windows Server 2012/SQL Server 2012 Always On cluster and Always On Availability Groups Multi-Subnet cluster and instances for SharePoint 2013, and I will be brutally honest, the documentation on either
    the MSDN and TechNet leave alot to be desired. Continually finding links in the documentation will take me from a Windows 2012 reference to a page talking about Windows Server 2008 or R2, The differences of which there are so many when it comes to configurations,
    settings, roles, services when working with SQL Server 2012. I have been confused, frustrated, screaming mad, with all the misdirection in this documentation.  The documentation takes me windows 2008 R2 which is different than 2012!
    Tired and trying to pick myself up off the floor!
    Greg
    Gman

    In general, DTC is not required for SQL 2012.  But, since you are asking specifically about SharePoint, it would be better to ask in a SharePoint forum.  They would be more likely to know those situations where FTC might be needed by SharePoint. 
    .:|:.:|:. tim

  • SQL Server 2005 64 bit and Oracle 9

    Hi,
    I have a situation which involves SQL Server 2005 64 bit and Oracle 9 32 bit,
    I have a requirement that involves creating Stored Procedures from Oracle 9 which will call tables from SQL Server 2005 64 bit, with operations involving 'Select' 'Insert' 'Update' and 'Delete'.
    it works fins, except when attempting to search for an SQL Server 'varchar' value, wher no mapping is done
    though the Oracle sees the field as 'varchar2'
    can anyone please advice on this
    thanks
    Basel

    I think you're somehow not getting a resuklt because you're query doesn't return any data.
    Why the fiealdA=pat=parameterA construct? Wouldn't it just work if you changed it to fieldA=parameterA?
    Also, can you not just define parameterA as a varchar to make them match?
    What if you do "select * from (<your query without where>) a where a.fieldA = :parameterA"
    While not efficient, it would make the filtering occur in Oracle and maybe that will let you see the problem in native Oracle land and then reuse the solution in your orginal query. If that doesn't work, drop the where clause and inspect the data closly and hardcode a simple where without using PL*SQL or bind variables.

  • SQL Server Processor/Core Licensing and Windows CALs

    I've scoured the internet for an answer to this question, so I'm assuming the scenario isn't as common as I think, or people are purposely looking the other way because they don't want to know the answer :)
    The application in question is pretty simple - An ASP.net web application using ASP.net forms auth (no end-user Windows Authentication).  Using Windows Server 2008 Web Edition, we've confirmed that no Windows CAL is required on the front-end web tier.
    So then on the back-end data tier (SQL Server) it also seems pretty straight forward.  As far as I can tell, the SQL Server licensing makes it pretty clear "...users who input data into, query, or view data through a web-based application... require
    a CAL".  So that makes it pretty obvious, you need a CAL or a per-processor/pre-core license of SQL Server.
    Here's where it gets tricky... What about the licensing requirements for the Windows Server that SQL Server is running on?  Do we need a
    WindowsCAL for each connection from the Web Tier to the SQL Server? Note that Windows CALs and SQL Server CALs are completely separate in terms if purchasing, and nothing says a SQL Server CAL is of a higher
    order than a Windows CAL (thereby covering both).
    It would seem ridiculous (IMHO) to allow unlimited connections to SQL, but then dump you back to the CAL model on Windows (since there is no "unlimited" option in Windows Server).  But licensing is a strange beast, and non-compliance is not
    something I'm interested in.
    Any insight with pointers to Microsoft documentation would be greatly appreciated!
    Thanks guys,

    For those of you who would like an answer on this without calling licensing support, here's the answer :)
    Windows Server 2012 does NOT have a CAL limitation for "public" web traffic.  I specifically asked about ASP.net Forms Authenticated users, and the licensing specialist said any website that uses anonymous authentication which then passes
    auth onto some other back-end process (e.g. ASP.net forms auth) you do not need a Windows CAL.  You DO need a Windows CAL if your application is somehow tied to services on the Windows box where the website user actually enters credentials which are authenticated
    against the local account store or domain controller.  So to me, that's a pretty simple answer - 
    anonymous auth = No CALs
    integrated auth = CAL required
    Ok, onto SQL Server... As quoted from my original post, SQL licensing makes it very clear that ANY connection to the database requires a CAL, even if it's multiplexed through IIS or some other middle-tier.  Bottom line? Simple answer here as well:
    public website with a SQL back-end = per-socket or core-licensing (since you can't count "CALs" on a public site)
    Finally, the most illusive question (for me anyway).  What about the copy of Windows running your SQL Server?  the answer here was  - No CALs required if it's purely a SQL Server connection.  Meaning, if all your Windows server is doing
    is running SQL Server and fielding query requests from your front-end IIS ASP.net app, you're do NOT need any Windows Server CALs.  You obviously do need SQL CALs or socket/core licenses, which I covered above.  You will however need Windows CALs
    on your SQL Server box for any Support specialists or Deployment folks who remote into the machine using TS or using UNC file shares and such to work with the server.
    Hopefully that helps someone else looking for a quick answer.  And as the moderator noted, if that doesn't make sense you should definitely call the licensing specialist.  They are very helpful and surprising quick to answer questions (without
    any sales pressure).
    Thanks for posting this, I am in the same boat. I will have a public facing web server and a backend SQL server. The web site requires all users to login so they can see the content. We use forms authentication as well (no Windows or Active Directory authentication).
    The application does all the authentication itself using the backend database (credentials are stored in a database table).
    I just called the licensing pre-sales number and spoke to a rep who said the web server would require CALs (or an External Connector in this case), because I am requiring people to login to view the content. He said it did not matter what the authentication
    method was. I clearly explained the web application handles all the authentication, but he still said we would need CALs in this case because users must authenticate to access the content. He likened it to a museum. If you need to buy a ticket to get in to
    see the content (in this case login to the web site), you need CALs he said.
    He also said I would need Windows Server CALs/EC for the Windows server that hosts the database. I will be using SQL Core licensing, so no additional SQL CALs will be needed.
    Just thought I would share what I learned.
    Sorry to dredge up an old thread, but I have been doing a lot of reading on CALs lately in anticipation of launching a public website.  Reading the license agreement, I don't think you need CALs on the front end Windows Server 2012 just because people
    are authenticating.  The Windows Server 2012 license agreement makes no mention of this that I can find.  It only says you need CALs for employees or your affiliates' employees.  A non-employee visitor does not fall under the definition an affiliate.
    The SQL Server licensing is tricky, and not written for public website access.  Is every user with an account to your online store need a CAL?  The only other option is SQL Server Enterprise licensed by CPU cores.

  • [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)

    Dear Experts,
    i am getting the below error when i was giving * (Star) to view all the items in DB
    [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)
    As i was searching individually it is working fine
    can any one help me how to find this..
    Regards,
    Meghanath.S

    Dear Nithi Anandham,
    i am not having any query while finding all the items in item master data i am giving find mode and in item code i was trying to type *(Star) and enter while typing enter the above issue i was facing..
    Regards,
    Meghanath

  • Required info on SQL Server Performance Issue Analysis and Troubleshoot way

    Dear All,
    I am going to prepare the simple documentation steps on SQL Server Performance Issue Analysis and troubleshoot method. I am struggling to make this documentation since we have different checklist (like network latency,disk latency, memory/processor pressure,SQL
    query tuning etc) to validate once application performance issue reported from the customer.So, I am looking for the experts document or link sharing .
    Your input will help for document preparation in better way.
    Thanks in advance.

    Hi,
    Recommendations and Guidelines on configuring disk partitions for SQL Server
    http://support.microsoft.com/kb/2023571
    Disk and File Layout for SQL Server
    https://blogs.technet.com/b/dataplatforminsider/archive/2012/12/19/disk-and-file-layout-for-sql-server.aspx
    Microsoft SQL Server 2012 Performance Tuning: Implementing Physical Database Structure
    http://www.packtpub.com/article/sql-server-2012-implementing-physical-database-strusture
    Database Mirroring Best Practices and Performance Considerations
    http://technet.microsoft.com/en-us/library/cc917681.aspx
    Hope the information helps.
    Tracy Cai
    TechNet Community Support

  • SQL Server Express 2012 ok, and is this better than 3rd party  SVC system?

    Hi. Can anyone advise if:
    RoboSource control will work on SQL Server Express 2012, or is some earlier version required.
    Is RoboSource control a more elegant (more integrated) solution than a 3rd party SVC system, such as our Perforce system (with MSSVC plugin installed on RH.)
    Thanks.
    -Kurt

    Hi Kurt.
    RoboSource Control to my knowledge hasn't been developed in recent releases. It is essentially the same product that existed years ago. It works, but does not have a lot of users. Most people, including myself, prefer to use third party products such as Perforce, SVN.
    As RoboSource Control is an old product and isn't widely used, I doubt whether anyone has tried using it on SQL Server Express 2012. That is not to say it won't work on it though.

  • SQL Server 2005 High Availability and Disaster Recovery options

    Hi, We are are working on a High Availability & Disaster Recovery Planning solution for an application database which is on SQL Server 2005. What different options have we got to implement this for SQL Server 2005 and after we have everything setup how
    do we test the failover is working?
    Thanks in advance.........
    Ione

    DR : Disaster recovery is the best option for the business to minimize their data loss and downtime. The SQL server has a number of native options. But, everything is depends upon your recovery time objective RTO and recovery point objective RPO.
    1. Data center disaster
    Geo Clustering
    2. Server(Host)/Drive (Except shared drive) disaster
    Clustering
    3. Database/Drive disaster     
    Database mirroring
    Log shipping
    Replication
    Log shipping
    Log shipping is the process of automating the full database backup and transaction log on a production server and then automatically restores them on to the secondary (standby) server.
    Log shipping will work either Full or Bulk logged recovery model.
    You can also configure log shipping in the single SQL instance.
    The Stand by database can be either restoring or read only (standby).
    The manual fail over is required to bring the database online.
    Some data can be lost (15 minutes).
    Peer-to-Peer Transactional Replication
    Peer-to-peer transactional replication is designed for applications that might read or might modify the data in any database that participates in replication. Additionally, if any servers that host the databases are unavailable, you can modify the application
    to route traffic to the remaining servers. The remaining servers contain same copies of the data.
    Clustering
    Clustering is a combination of one or more servers it will automatically allow one physical server to take over the tasks of another physical server that has failed. Its not a real disaster recovery solution because if the shared drive unavailable we cannot
    bring the database to online.
    Clustering is best option it provides a minimum downtime (like 5 minutes) and data loss in case any data center (Geo) or server failure.
    Clustering needs extra hardware/server and it’s more expensive.
    Database mirroring
    Database mirroring introduced in 2005 onwards. Database Mirroring maintain an exact copy of a database on a different server. It has automatic fail over option and mainly helps to increase the database availability too.
    Database mirroring only works FULL recovery model.
    This needs two instances.
    Mirror database always in restoring state.
    http://msdn.microsoft.com/en-us/library/ms151196%28v=sql.90%29.aspx
    http://blogs.technet.com/b/wbaer/archive/2008/04/19/high-availability-and-disaster-recovery-with-microsoft-sql-server-2005-database-mirroring-and-microsoft-sql-server-2005-log-shipping-for-microsoft-sharepoint-products-and-technologies.aspx
    http://www.slideshare.net/rajib_kundu/disaster-recovery-in-sql-server
    HADR Considerations
    Need to Understand the business motivations and regulatory requirements that are driving the customer's HA/DR requirements. Understand how your customer categorizes the workload from an HA/DR perspective. There is likely to be an alignment between the needs
    and categorization.
    Check for both the recovery time objective (RTO) and the recovery point objective (RPO) for different workload categories, for both a failure within a data center (local high availability) and a total data center failure (disaster recovery). While RPO and
    RTO vary for different workloads because of business, cost, or technological considerations, customers may prefer a single technical solution for ease in operations. However, a single technical solution may require trade-offs that need to be discussed with
    customers so that their expectations are set appropriately.
    Check and understand if there is an organizational preference for a particular HA/DR technology. Customers may have a preference because of previous experiences, established operational procedures, or simply the desire for uniformity across databases from
    different vendors. Understand the motives behind a preference: A customers' preference for HA/DR may not be because of the functions and features of the HA/DR technology. For example, a customer may decide to adopt a third-party solution for DR to maintain
    a single operational procedure. For this reason, using HA/DR technology provided by a SAN vendor (such as EMC SRDF) is a popular approach.
    To design and adopt an HA/DR solution it is also important to understand the implications of applying maintenance to both hardware and software (including Windows security patching). Database mirroring is often adopted to minimize the service disruption
    to achieve this objective.
    HADR Options :
    Failover clustering for HA and database mirroring for DR.
    Synchronous database mirroring for HA/DR and log shipping for additional DR.
    Geo-cluster for HA/DR and log shipping for additional DR.
    Failover clustering for HA and storage area network (SAN)-based replication for DR.
    Peer-to-peer replication for HA and DR (and reporting).
    Backup & Restore ( DR)
    keep your server DB backups in network location ( DR)
    Always keep your sql server 2005 upto date, in case if you are not getting any official support from MS then you have to take care of any critical issues and more..
    Raju Rasagounder Sr MSSQL DBA

  • SQL Server Express 2008 R2 and Windows 8.1 (Standard)

    I recently re-engineered the backend of a legacy Access 2003 application because we knew that going forward we were going to loose the replication capability in Access. This is a small, departmental app, so the new SQL Server Express 2008 R2 backend is
    hosted on a robust Windows 7 system. I tested the implementation with both Windows XP and Windows 7 clients running the updated Access 2003 frontend and everything worked great.
    We are now in the midst of a company-wide upgrade to Windows 8.1 and I'm having issues. The legacy frontend works fine with Access 2013 (full version) when run locally on the Win7 machine, but I can't get any of the new Win 8.1 clients to connect to the
    SQL database using the Access 2013 Runtime module. I CAN create ODBC connections to SQL Server from the clients and they test successfully, so I think I have a valid SQL connection to the Win 7 box.
    To recap: old clients were WinXP Pro with Office 2003 Pro, new clients are Win 8.1 (non-Pro) with Access 2013 Runtime module.
    Any ideas?

    Hi ,
    Glad to hear that you have found the solution. Thank you for coming back and let us know the result:)
    Best Regards,
    Tracy
    Tracy Cai
    TechNet Community Support

  • Linked Server error: Login Failed for user 'NT AUTHORITY\ANONYMOUS LOGON' between sql server 2005 32 bit and sql server 2012 64 bit

    Hi All,
    Here the linked server is created between sql server 2012 64 bit and sql server 2005 32 bit. I am getting the below error  when i try to access linked server from third server. I have created linked from Instance 1 to Instance 2. When i access it from
    instance 3 i am getting the below error. SPN setting has been done between these 2 servers. Also the option 'Trust the delegate' is enabled for the both the service account. 
    'Login Failed for user 'NT AUTHORITY\ANONYMOUS LOGON' 
    Appreciate your quick response. 
    Vikas.M.S

    Hello,
    Please read the following resources:
    http://www.databasejournal.com/features/mssql/article.php/3696506/Setting-Up-Delegation-for-Linked-Servers.htm
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ea26de43-4c6b-4991-86d7-e1578f107c92/linked-server-login-failed-for-user-nt-authorityanonymous-logon?forum=sqldataaccess
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Oracle equivalent of SQL Server's "FOR XML" and "OPENXML"

    Hi
    Can someone please tell what are the Oracle's equivalent of SQL Server's "FOR XML" and "OPENXML" features?

    Probably you can try General XML forum General XML
    Gints Plivna
    http://www.gplivna.eu

  • Can i use sql server express 2008, 2012, and 2014 for commercial purpose?

    Good day,
    I saw that the sql server express 2005 can be used for commercial purpose without buying additional license
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8df18025-fc2b-43c2-8476-532336ff09e3/sql-server-express-for-commercial-use?forum=sqlexpress
    the question is can I do the same for sql server express 2008,2012, and 2014?
    can I install and use sql server express 2008, 2012 and 2014 on an azure vm? specifically
    http://azure.microsoft.com/en-us/pricing/details/virtual-machines/
    A0 instance
    just an off topic question, is it required to pay to use sql server on virtual machines?
    why is there a different pricing here
    http://azure.microsoft.com/en-us/pricing/details/virtual-machines/#Sql

    Hello,
    Yes, you can use all versions SQL Server Express for commercial use. Please read more resources about it.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/01dbc5c3-b5fe-42d4-9eb9-91683cf8285b/can-any-commercial-application-that-uses-sql-server-express-freely-redistribute-the-sql-server?forum=sqlexpress
    https://social.technet.microsoft.com/Forums/en-US/661ebf2e-ff2f-4dae-a8ae-e2179a764c09/sql-server-2012-express-in-commercial-product?forum=sqlexpress
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Question on Creating table from another table and copying the partition str

    Dear All,
    I want to know whether is there any way where we can create a table using another table and have the partitions of the new table to be exactly like the used table.
    Like
    CREATE TABLE TEST AS SELECT * FROM TEMP;
    The table TEMP is having range and hash partitions.
    Is there any way when we use the above command, we get the table partitions of TEMP to be copied to the new table TEST.
    Appreciate your suggestions on this one.
    Thanks,
    Madhu K.

    may this answer your question...
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:595568200346856483
    Ravi Kumar

  • The type of the database table and work area (or internal table)...

    Hello
    I am trying to use a database and select all records from it and store them into an internal table.
    My code:
    Select * from xixi_dbcurrency into table gt_currency.
    The error:
    "The type of the database table and work area (or internal table) "GT_CURRENCY" are not Unicode-convertible . . . . . . . . . .     "
    Any suggestions?
    Thank you

    Hi Thomas,
    Thank you for your inputs above.
    But as you suggested is we use INTO CORRESPONDING FIELDS OF TABLE then it resolve the error.
    But I have below piece of code:
    DATA:    it_new_source TYPE STANDARD TABLE OF _ty_s_sc_1,
                  wa_source TYPE _ty_s_sc_1,
                  wa_new_source TYPE _ty_s_sc_1,
                  ls_target_key TYPE t_target_key.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_new_source
           FROM /bic/afao06pa100
           FOR ALL ENTRIES IN SOURCE_PACKAGE
           where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
           and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    But since this is reading into corresponding fields of table the data load from one DSO to other DOS is running for long more that 15 hours and still not getting completed and giving dump.
    So if I switch the search to below:
    SELECT * FROM /bic/afao06pa100
       INTO TABLE it_new_source
           FOR ALL ENTRIES IN SOURCE_PACKAGE
           where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
           and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    Then I am getting below error:E:The type of the database table and work area (or internal table) "IT_NEW_SOURCE" are not Unicode convertible.
    Can you please advice on this, as performance need to improve in start routine code.
    Thank You.

  • Parent values should be enter into child table in 11g adf

    HI ALL,
    i' m using oracle 9i with 11g adf jdeveloper.
    I have one parent table and child table respectively . I'm display both the parent and child table in one jsf page.Some fields/records in child table have same as in parent table.so when we enter values in parent fields the child table value should be placed.
    Ex:
    PARENT TABLE
    ID
    NAME
    LOC
    SAL
    DEPART
    COMP
    CHILD TABLE
    CID
    PID
    CNAME
    LOC
    SAL
    DEPART
    CNO
    CPNR
    LOC,SAL and DEPART are common fields in both tables
    I display all the feilds in parent table , but i won't display LOC,SAL and DEPART field from Child table . Now i when i fill value in fields and fire submit . the values of LOC,SAL and DEPART parent table values should be enter in child table fields
    Thanks in advance.

    Create a custom Application Module method and expose it to the AM client interface. In it set the child VO attributes from the parent VO and submit. Bind this custom method to your Submit in the ViewController and call it from a backing bean.
    Regards,
    Nick

Maybe you are looking for

  • IMac 2013 and Windows 8.1 Connectivity

    Up until I installed Yosemite, I could connect my new Windows 8.1 computer to my iMac external hard drives. ( I have 5 of them hooked up to the iMac) and could access all of my files.) without a problem. Now I can't access not 1 one of them. I can ge

  • Customer Vendor Ref. No. in Incoming Payment

    B1 8.8 PL14 and PL18 Are we able to include the Customer Vendor Reference Number in the Incoming Payment? 1. Open Incoming Payment 2. Select Form Settings 3. Cust./Vendor Ref No is selected as Visible but the Incoming Payment window does not display

  • This Device cannot find enough free resources that it can use (error 12)

    I have been using Hyper-V to test parts of my deployments in sccm 2012 r2 for some time now, and yesterday, they would not complete. Turns out the error in the topic is what is causing it. See below for a screenshot in devmgmt of the error causing th

  • Error ORA-07217 starting Oracle9i

    Having tried to use Oracle on WindowsMe..., I am now trying RedHat Linux 7.3. I have tried installing Oracle9i standard edition. I had one error during installation which meant the Database Configuration Assistant did not run properly. When I try to

  • Https serverfarm with http sorry server

    Hello all,   I am having difficulty configuring a sorry server for an existing https serverfarm.  The sorry (backup) server is failing all connections and I think it's because I can not determine a way to differentiate ssl connections for the product