Replication for Data on DEV and QA - bad idea - primary key problem now

I goofed.  I tried to use replication to keep the data on my dev machine up to date with the live server.  Now when I try to work on the database, adding new stuff, it fails.  It says there is a primary key problem every time I try to add
a new item to a table with my program.  I should have realized this would happen!  Now, even though I've removed the replication, I'm having the problem.  Can anyone help me get my database functional again :/  Or should I resort to a database
restore.  Thanks!

So you have an IDENTITY column in your table? Run a
DBCC CHECKIDENT (Transact-SQL) command with option RESEED to fix the current identity value to see if it works then.
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • MB5B Report for Date Wise Stock and Value

    Hi,
    I am Taking MB5B Report for Date Wise Stock and Value.
    But I have one doubt all stocks is coming or not in these report like Unrestrected Stock,Return Stock.Blocked stock,Transist stock,Restrected Stock,qty Inspection Stock.
    I have another Doubt in these report three Stock type indicaters are there like these.
    1.Storage Location / Batch Stock
    2.valuated Stock
    3.Special Stock.
    But i have one doubt what is defferent these
    1.Storage Location / Batch Stock
    2.valuated Stock

    Hi Prasad,
    Yes MB5B report consider the Unrestricted, Quality, Blocked, Transit stock and restricted stock. Not sure about Return Stock.
    If you select the Storage location/Batch stock radio button then the system will display all the possible stock from the storage location and the corresponding batch also.
    If you select Valuated stock radio button then system will show only the valuated stock not the Non-valuated stock. Because Non-valuated material type is available in SAP system will not show those stock suppose if you select the Valuated stock radio button.
    Regards
    Karthick

  • Hello, I´ve bought a wrong app. It´s for an I-pad and I have an I-pod. Now I want to give it back and I don´t know how to do this. What do I have to do?

    I´ve bought a wrong app. It´s for an I-pad and I have an I-pod. Now I want to give it back and I don´t know how to do this.

    Sorry Noel, but according to Apple, all sales are final >  iTUNES STORE - TERMS AND CONDITIONS

  • My brother ipad was linked with old apple id and he forgot his id and never use same email.the problem now his mini ipad ask him for this id to open (activate ipad) what we can do ?

    my brother ipad was linked with old apple id and he forgot his id and never use same email.the problem now his mini ipad ask him for this id to open (activate ipad) what we can do ?

    He remember the id name and password but he can't enter we don't now if the password is wrong or the id was  lock . I have the all thing for the ipad such as his box . I now this is security thing but you could help me.

  • I just paid for Adobe PDF pack and I think I am having problems installing. When I select to print from word, PDF is not an option. Help!

    I just paid for Adobe PDF pack and I think I am having problems installing. When I select to print from word, PDF is not an option. Help!

    Hi voltric2014,
    If you are on Windows, you can download and install the CreatePDF Desktop Printer, which would allow you to "print" to PDF from Word. You'll find a link to the installer on the CreatePDF page at https://cloud.acrobat.com. Here are the instructions for installing it: Using Adobe PDF Pack
    Please let us know if you have additional questions.
    Best,
    Sara

  • I plugged my phone into my computer for the first time and it restarted my whole phone so now all my apps say waiting put I'm let my phone sync a view different times and it still doesn't work. Has anyone else had this problem?

    I plugged my phone into my computer for the first time and it restarted my whole phone so now all my apps say waiting put I'm let my phone sync a view different times and it still doesn't work. Has anyone else had this problem?

    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • Hi All,How2 delete a pkey for std table and add 2 new primary keys

    Hi All,
            How2 delete a pkey for std table and add 2 new primary key fields .Please provide me the required procedure .
    Thanks&Regards.
    Bharat.

    Hi Bharat,
    First thing is you need to have the access key to change any standard dictionary object/standard programs/ standard transactions.You may get this from your basis person after getting approval from your respective manager.But changing or modifying the standard object is not recommended, but if there is no alternate to meet the business requirement then we have to follow this way only.
    Next, you need to check whether this table's primary key is being used in any other table as foreing key or not. If there is, then you must remove this relation and then you can delete the unncessary primary key field from that table.Finally you can add the two new fields and set them as primary key, save, check for any errors and activate.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • EJB3: One-to-one relationships and auto-generation of primary key values...

    Dear Forum,
    I'm relatively new to JEE, and while I've so far enjoyed the convenience of EJB3 for most things, it seems that I have a corner case that can not be handled by the entity manager.
    First, here's a quick mockup of my entities:
        Gallery
                |
                -- [1] -------[1] ----> Author
                |
                -- [1] -------[M] ---> Photo
                                                  |
                                                  -- [1] ------ [1] -> PhotoImage
                                                                                     |
                                                                                     -- [1] ------ [1] -> IPTCData
                                                                                     |
                                                                                     -- [1] ------ [1] -> EXIFDataI also have a remote, stateless session bean that does nothing more than persist()/merge()/remove() and locate (through find() and a few custom queries) my Gallery and Photo instances.
    Now, the abridged version of my problem is this: when I persist a Photo, it naturally gets its primary key generated (I used @Id and @GeneratedValue). However, for some reason none of the other dependent entities inherit Photo's primary key value. In my client, I create a new Gallery locally and then persist it. I then create new Photo, PhotoImage, IPTCData and EXIFData instances. I add the IPTCData and EXIFData instances to PhotoImage (there are PhotoImage methods for adding those); then I add the PhotoImage instance to Photo (again, Photo has a setter for adding a PhotoImage). Then, I persist the Photo.
    --- Aside: ------------
    I've set up my relationships using annotations like @OneToMany (Gallery references a Collection of Photos), and @OneToOne (Photo's primary key references PhotoImage's primary key; PhotoImage's primary key references the primary keys of IPTCData and EXIFData). I've also added @JoinColumn annotations where necessary.
    Finally, I get the Gallery instance's Photo collection (public Collection<Photo> getPhotos()), I add the Photo to the collection, and I add the Photo collection BACK to the Gallery (public void setPhotos(Collection<Photo>)).
    At this point, the Gallery should have all of my entities contained inside of itself. However, when I persist the Gallery at this point, all of the entities show up in the database, but none of the primary keys get inherited. Photo's primary key gets generated automatically, of course, but the rest have zero (0) as their PK values. I had wanted, for example, IPTCData to get the value of Photo.id.
    I had assumed that the entity manager would persist everything for me provided that I told it, through my annotations, about which entities relate to which. Does persistence only work in the direction of retrieval? That is, does the entity manager only do its thing when fetching (versus setting) data when there is more than 1 object in the graph? I can't believe that it can't, otherwise we'd all be ditching it and going back to straight SQL to do our work.
    Thus, I HAVE to be doing something wrong, or else omitting to do something right.
    I've made other incarnations of the above setup, and none of them have worked perfectly. I've even set up foreign key constraints in the database, but I had my share of unresolvable problems there, too.
    So I guess my big question with all of this is: when you have a deeply nested graph of objects, can the entity manager figure everything out and persist all of the objects correctly and with the right values? If not, boo. If so, how does one accomplish this?
    I know that I could persist each and every entity separately in my client code, but I wanted to have a natural-looking way of piecing all of my entities together. More specifically, I could persist IPTCData explicitly; however, I want to be able to add everything to a Photo and only persist the Photo itself, with the idea that all of the objects and sub-objects would be persisted automagically.
    Is this possible? Or have I bought into a pipe dream with the guarantee of the proverbial magic bullet?
    Thanks to everyone in advance for his/her input.
    Regards,
    Michael

    Daniel,
    Late last night I found the solution to my problem. And you're right, it had everything to do with which side is wired to which. I got confused about which side to consider the "owning" side, since one can look at it from the perspective of the database or the application.
    Interestingly, the first 2 lines of your example code match my client code almost verbatim: First, I create a new Gallery (or else I get an existing one). I then create a new Photo and then add it to the Gallery's collection using add(). I then persist the Gallery. My session bean internally calls EntityManager.merge(gallery). How it differs from your example, though, is in the fact that, on an application level, a Photo has no knowledge whatsoever of a Gallery. Which is to say that my Photo class does not have a 'getGallery()' method. Somehow, Hibernate is able to figure it all out and still update Photo's 'parentIdRef' column in the database. My logs show that Hibernate issues a SQL UPDATE on the Photo after both a Gallery and a Photo have been created. It sets the Photo's 'parentIdRef' column to the primary key value of the owning Gallery.
    Getting back to the matter, my problem was not with being able to map a Photo to a Gallery; rather, I was unable to add a PhotoImage to a Photo and have the relationship get correctly mapped in the database. The relationship between a Photo and a Gallery is many-to-one: there can be many Photo objects inside of a Gallery. In the database, a Photo row contains a 'parentIdRef' column whose value is that of a Gallery's primary key. I used @OneToMany on the Gallery, since a Gallery is, from an application perspective, the "owning" side, even though it's only the Photo that knows who it's referring to since only IT contains the 'parentIdRef' column in the database.
    I tried setting up the relationship between a PhotoImage and a Photo in the same manner, with the PhotoImage having a 'parentIdRef' column and referring to a Photo's primary key. I had annotated the Photo's getPhotoImage() method with @OneToOne, along with an appropriate @JoinColumn.
    It was THIS part that I had backwards. With a @OneToMany relationship, the child refers back to the parent --- it can be no other way. However, with a @OneToOne relationship, the owner refers to the child.
    So, to make a long story short, all I had to do was create extra database columns for Photo. Those columns refer to the primary keys of PhotoImage, EXIFData and IPTCData. Concretely, for example, Photo.photoImageIdRef references PhotoImage.id. And so on and so forth.
    The only negative side-effect of this is that my database-level foreign key constraints are now broken, since Hibernate wants to persist PhotoImage, EXIFData and IPTCData before it persists Photo.
    I have to investigate more deeply the 'cascade=...' option of the @OneToOne annotation in order to find out it relates, if at all, to a database-level cascade.
    Anyway, thanks for the reply. It seems that you had a very good idea about what my problem was. I would have posted the fact that I had resolved the problem last night, except that it was too late and I was heading to bed. If you still want the Duke points, let me know. I don't currently know the rules about if, when and to whom I should issue points in cases like these when I've already solved the problem.
    Regards,
    Michael

  • How to create entity for the table which is not having the primary key

    Hi,
    Is it possible to create an entity for the table which is not having the primary key.
    I have to write a method in my session bean and that method must use this entity.
    any websites for this.

    If you are talking about processes launched from a JVM (running outside), Process is available.
    If you are talking about processes already running outside of a JVM, you could roll-your-own class to provide similar functionality as Process. This approach would be platform dependent, backed by the platform's I/O scripting and therefore limited to what the platform supports for process manipulation, e.g. Linux/Unix capabilities far exceed Windows.

  • Hi. My id country was Saudi Arabia and I bought lots of apps from it. Now I moved to USA and changed my id counrty. the problem now is that every app that I buy in the USA store and I had already bought in the Saudi store won't appear on my purchased list

    Hi. My id country was Saudi Arabia and I bought lots of apps from it. Now I moved to USA and changed my id counrty. the problem now is that every app that I buy in the USA store and I had already bought in the Saudi store won't appear on my purchased list

    Tell me exactly how much you have in your store credit and I"ll let you know the best solution.
    Also, I'm not 100% sure, but when you switch back to S.A., Apple MAY track your IP and still give you probs if they figure you're trying to get around this problem without moving out of America. But we won't know for 100% until we try it.
    If your store change is less than the price of a single song, then you can ask the iTS support to just cash-out that balance. They'll probably send you a response to reverify this first though.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html
    Once you change back to S.A. please let us know if you can still see the purchases in the Cloud or not from your US I.P. address as I'm curious if they've fixed this exploit fully or not.

  • New tab for Contract for data about products and product sales.

    Looking for ideas to implement a new tab on the Contract (RECN)
    We have some basic data about products and product sales that we want to have implemented on a screen tab for a contract.  The user needs to be able to enter information about a product, quantity, year grown, and tax info. And then each of these products may have one or many sales records showing date of sale, quantity sold, and a brief note.
    So a contract can have 1 or many products and a product can have one or many sales records.
    The user needs to be able to enter, update and delete any one of these records.  And, ideally, enter multiple of each before saving.
    Do any of you have ideas about how to go about this?  Using ALV grids? or table controls? I'm still wet behind the ears regarding doing screen development in SAP so am open to any and all suggestiions.
    SAP 6.4 is the version we are at.
    Thanks
    Laurie

    Maybe the original order to renew and keep unlimited data was cancelled because it was not an option. It wasn't a "bait-and-switch" The order was cancelled, it wasn't switched. When you called to reissue the order they told you the correct options so they did not switch you without your knowledge. The second rep was correct, he didn't lie, the first rep did. Verizon cancelled the order because if they didn't you would have been set up w/ new 2 year agreements on a tiered data plan, which would have been illegal. Thats why they cancelled it. So you can either not make the change, keep the unlimited data and buy the phones outright. Or switch, go to a tiered plan, and get new phones. By glitch they meant the system accidentally allowed you to keep the unlimited plan, though it was not an option. Verizon has had this rule since they removed the unlimited plan back in '11.
    << Full name of rep removed >>
    Message was edited by: Verizon Moderator

  • Inconsistencies data between ODS and RSA3 in SAP system (delta problem??)

    Hi everyone,
    I have a problem in my SAP BW production system. There is inconsistencies data between ODS (using tcode LISTCUBE) and Datasource in SAP system (tcode RSA3).
    I'm using Datasource: 0FI_GL_10 and ODS: 0FIGL_O10.
    In SAP system (using RSA3):
    GL Account: 1202012091
    Comp Code : 5400
    Bus Area: 5401
    Fiscal Year :2008
    Period: 07
    Accum Balance : $0
    Credit Total: $350
    Debit Total: $350
    Sales : $0 
    And in ODS (using ListCube):
    GL Account: 1202012091
    Comp Code : 5400
    Bus Area: 5401
    Fiscal Year :2008
    Period: 07
    0BALANCE : $350  (it should be $0,shouldn't it? )
    0CREDIT: $0 (it should be $350,shouldn't it? )
    0DEBIT: $350
    0SALES: $350 (it should be $0,shouldn't it?)
    I have tried these :
    1. Check if there is a start routine / routine or not in transfer or update rules....and...i get nothing
    2. Check the data using tcode FBL3N..but the data is ok
    And then i tried to trace the process chain and find error on delta infopackage which pull these data
    Date
    07.30.2008 : 231141 records --> error (ODS activation) --> request has deleted forever
    07.31.2008 : 2848 records   --> error (ODS activation) --> request has deleted forever
    08.01.2008 : 135679 records --> error (ODS activation) --> request has deleted forever
    08.02.2008 : 135679 records --> successfull repeat delta action
    From 30 July until 1 August there is an error on delta infopackage because
    fail to activate ODS (No SID found for value 'RIM' of characteristic 0UNIT). On 2 August someone delete the red requests and repeat the delta and success. Is there any possibilities that this problem arise because of this? If this the cause, how to bring back 2848 and 231141 records which has deleted?
    Thank you and Regards,
    -Satria-

    Hi everyone,
    I have solved my problem. I executed my infopackage again (selection condition using GL Account which have wrong amount) with update mode 'Full update' and choose Scheduler > Repair Full Request and tick the checkbox.Thank you.
    Regards,
    -Satria-

  • APEX 4.0 -Show and able to change Primary key values for Detail

    In a Master-Detail form, is there anyway I can show and able to change/select my primary keys from a select list field? One of my primary keys on the Detail is also primary key from another table which restricts my values for this field. I was able to show the fields but I can not make changes to this field and save the changes. Is there anyway I can have both show the field and able to change field's value and save it? Please advice. Thank you very much for your help in advance.
    -Grace

    Yes AFAIK Apex (for better or worse) was designed such that the PKs are generated automatically with PL/SQL, by a trigger, or whatever other algorithm that isn't in the control of the end user. It also only seems to allow a composite PK of no more than two columns.
    My usual strategy is to:
    1. Define the PK as a number (some sort of RECORD_ID, RECORD_SEQ, whatever) and populate it via a trigger on-insert.
    2. Define the "business" PK as a separate unique index. This way the user can set and modify it to their heart's content and it also isn't limited to just two columns (if the composite key's business requirement is such that more than two columns are needed).

  • I am trying to import an mp3 audio file into garage band for editing.  drag and drop doesn't work. What now?

    I am trying to import an mp3 audio file into garage band for editing.  Drag and drop does not work. any ideas?

    Try reposting in the Garageband forums. You can find it at:
    https://discussions.apple.com/community/ilife/garageband

  • Problem with JPA Implementations and SQL BIGINT in primary keys

    I have a general Question about the mapping of the SQL datatype BIGINT. I discovered, that there are some different behaviour depending on the JPA implementation. I tested with TopLink Essentials (working) and with Hibernate (not working).
    Here is the case:
    Table definition:
    /*==============================================================*/
    /* Table: CmdQueueIn */
    /*==============================================================*/
    create table MTRACKER.CmdQueueIn
    CmdQueueInId bigint not null global autoincrement,
    Type int,
    Cmd varchar(2048),
    CmdState int,
    MLUser bigint not null,
    ExecutionTime timestamp,
    FinishTime timestamp,
    ExecutionServer varchar(64),
    ScheduleString varchar(64),
    RetryCount int,
    ResultMessage varchar(256),
    RecordState int not null default 1,
    CDate timestamp not null default current timestamp,
    MDate timestamp not null default current timestamp,
    constraint PK_CMDQUEUEIN primary key (CmdQueueInId)
    The java class for this table has the following annotation for the primary key field:
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "CmdQueueInId", nullable = false)
    private BigInteger cmdQueueInId;
    When using hibernate 3.2.1 as JPA provider I get the following exception:
    avax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:176)
    at $Proxy16.persist(Unknown Source)
    at com.trixpert.dao.CmdQueueInDAO.save(CmdQueueInDAO.java:46)
    at com.trixpert.test.dao.CmdQueueInDAOTest.testCreateNewCmd(CmdQueueInDAOTest.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at
    Caused by: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:59)
    at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:35)
    at org.hibernate.id.IdentityGenerator$BasicDelegate.getResult(IdentityGenerator.java:157)
    at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
    at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
    at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
    ... 34 more
    This means, that their ID generator does not support java.math.BigInteger as datatype.
    But the code works if I take TopLink essentials as JPA Provider.
    Looking at the spec shows the following:
    In chapter 2.1.4 "If generated primary keys are used, only integral types will be portable." Integral datatypes are byte, short, int, long and char. This would mean, that the Hibernate implementation fits the spec but there seem to be a problem in general with BIGINT datatypes.
    I use a SYBASE database. There it is possible to declare a UNSIGNED BIGINT. The range of numbers is therefore 0 - 2^64 - 1. Since in Java a long is always signed it would mean its range is from -2^63 -1 to 2^63 -1. So a mapping of BIGINT to java.lang.long could result in an overflow.
    The interesting thing is, that I used NetBeans to reverse engineer an existing database schema. It generated for all Primary Keys of Type BIGINT automatically a java.math.BigInteger. But for other fields (not being keys) it mapped BIGINTs to java.lang.long.
    It looks like there are some problems with either the spec itself or the implementation of it. While TopLink seems to handle the problem correctly, Hibernate doesn't. But Hibernate seems to fulfill the spec.
    Is anybody familiar with the Spec reading this and can elaborate a little about this situation?
    Many thanks for your input and feedback.
    Tom

    Not sure if I clearly understand your issue, would be good if you can explain it a bit more clearly.
    "I select a value from LOV and this value don't refresh in the view"
    If you mean ViewObject, check if autoSubmit property is set to true.
    Amit

Maybe you are looking for

  • Issue in wrapping of text in TextEdit control

    Hi, I'm developing an occasionally connected application using NetWeaver Mobile 7.1. In one of the view, I use TextEdit control to display the address information where the address is a multiline text data. During testing of the application in the si

  • I can't connect my mobile x6-00 to my computer thr...

    When I connect it vi suite keep telling me that USB  drivers are being installed on your computer so I left it for 24 hours the computer is and when I woke up the next day still installing I think that some drivers cannot take that long Solved! Go to

  • Computer still on

    I was turn off my computer but I look the broadband router light was on from my computer, turn on my computer, router stay on. I pull the power plug, went off. plug in the power, still off. turn on my computer,turn on. It still on when i turn off my

  • Facing error ora-00257 ARCHIVER ERROR. CONNECT INTERNAL ONLY, UNTIL FREED

    Hi, Has been facing this error since midnight no 1 is able to login to database. Iam having 10 GB of space in 1 instance & 4GB in another where archive log destination is there . Has tried more or less all the solutions on net as well as metalink, fo

  • Retrive document path from R/3 system

    I'm trying to retrive the document path (FILEP) from DRAW table in r/3 system to be displayed in my report i'm using remote cube and all other column are displayed perfectlt but when i choose this (FILEP) I'm getting the following error. <b>Error val