How do I change an INT field to IDENTITY auto-increment by 1 Starting at 30000?

I have a SQL table with data already in it, and an INT field called fldPeopleID.  I can change it manually to IDENTITY seed (30000,1) but I want to do it using code.  I tried the wording
ALTER TABLE [PicSmartMaintenanceDB].[dbo].[tblPeople2] ALTER fldPeopleID INT IDENTITY ( 30001,1 ) NOT FOR REPLICATION
but I get the error:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'IDENTITY'.
Can someone tell me the proper syntax to use?  Thanks!
Jim Fuchs, Davenport, IA

I can change it manually to IDENTITY seed (30000,1) but I want to do it using code
Hello Jim,
When you do it in SSMS Designer then have a look at the generated script: The table will be renamed, a new table with identity will be created, the data copied and the old table dropped.
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • How can we change the input field on a view stop showing zeros

    Hello,
           To make screen look consistent with other character input field. How can we change the input field on the view stop displaying zeros even though the data type is NUMC and data type should not be change?
    Edited by: sap_learner on Mar 25, 2010 5:44 PM
    Edited by: sap_learner on Mar 25, 2010 5:49 PM
    Edited by: sap_learner on Mar 25, 2010 5:55 PM

    hello Manas Dua,
                           Thanks for your help. I am able to resolve my problem.
    My code will help  the future comers to resolve this kind of issues.
    *The code is applied to method WDDOINIT of the default view.
      DATA lo_nd_terms_input    TYPE REF TO if_wd_context_node.
      DATA lo_nd_terms_input_i TYPE REF TO if_wd_context_node_info.
      DATA lv_zeros             TYPE wdy_attribute_format_prop.
      lv_zeros-null_as_blank = 'X'.
      lo_nd_terms_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
      lo_nd_terms_input_i = lo_nd_terms_input->get_node_info( ).
      lo_nd_terms_input_i->set_attribute_format_props(
        EXPORTING
          name              = `ENTER THE ATTRIBUTE NAME`
          format_properties = lv_zeros     ).
    Edited by: sap_learner on Mar 26, 2010 5:02 PM

  • I am using a 5s under IOS 7.1.1. How can I change the year field directly when editing an existing calendar entry?

    I am using a 5s under IOS 7.1.1. How can I change the year field directly when editing an existing calendar entry?

    Glad that helped.
    Enjoy your iPhone!

  • How do i change the time line in Au from time since recording start to the actual time?

    how do i change the time line in Au from time since recording start to the actual time? I have a recording that was started at 10:00 but obviously in Au it starts at 0:0:00. Basically i want to time shift this to 10:00:00

    In the Properties panel, modify the Start Time parameter.

  • How Do You Change A Numeric Field To Blank When Zero?

    I'm using Adobe Acrobat 6.0 Professional, version 6.0.6.
    Can anyone help me with the code to change a numeric field to blank, when "0.00"?

    "no success" does not provide much to go on.
    With your scripts, I get the concatenation of the sting values, so one has to force JavaScript to convert strings to numbers.
    Make sure your field names are exact including case.
    Make sure the calculation order is correct.
    The following scripts all work:
    var fa = 1 * this.getField("FeeN01").value;
    var fb = 1 * this.getField("FeeN02").value;
    var fc = 1 * this.getField("FeeN03").value;
    event.value = fa + fb + fc;
    if ((event.value == 0)) {
    event.value = ""
    // or
    var fa = this.getField("FeeN01").value / 1;
    var fb = this.getField("FeeN02").value / 1;
    var fc = this.getField("FeeN03").value / 1;
    event.value = fa + fb + fc;
    if ((event.value == 0)) {
    event.value = ""
    // or
    var fa = Number(this.getField("FeeN01").value);
    var fb = Number(this.getField("FeeN02").value);
    var fc = Number(this.getField("FeeN03").value);
    event.value = fa + fb + fc;
    if ((event.value == 0)) {
    event.value = ""
    The "sum of" also works with the "Custom validation script" of:
    if (event.value == 0) event.value = "";

  • How do you change an xml field inside of a database?

    Please: can you tell me how do you update an xml file?
    I mean how do you edit an xml field?
    Paola
    @{---->>----->---------                                                                                                                                                                                                                                                                       

    It should work for Oracle 9.2 and 10.2
    Thank you Dany.
    Regards.
    Paola
    @{--->----->>----------                                                                                                                                                                                                               

  • How do i change the incoming sms to stop people from seeing the start of my new message?

    when i recieve a new sms it arrives as" new event" & shows the start ofte the message. how can i chang this so no-one can see my messages?
    i have a sony ericsson elm, my last sony ericsson had an option where i cohuld change it but tis one dosnt seem to have the option.

    thanx alot

  • Single Field Identity & Auto-Increment

    I was wondering if I could use single field identity and auto-increment
    together? I've tried it, my code compiles and enhances ok, but it throws
    and exception when I tried to run a unit test.

    We have many users using single field identity and auto-increment together.

  • How can I change the "From:" field in iOS Mail?

    This is a weird one.
    I have a gmail work email account that has been set up for me. There's a primary email address assigned to it, and a secondary one (which is the one I want to use).
    No problem at all sending from the secondary account on my MacBook Pro. I just hit the drop down menu by the "From:" field, and I can select it from there.
    However, when I send from my iPhone, I'm only given the option of sending from my primary email address, not the secondary one. This is despite the fact that I've synced Mail accounts via iTunes.
    Any idea how I might fix this so I can send from the secondary account on my iPhone?

    First of all, please fill in the Computer Model and Operating System fields on your My Settings’s profile (and click Save). This is essential information that should always be provided when asking for help.
    Now, what does “I can't change it” mean? What appears in the From header of the messages you send is determined by your Mail > Preferences > Accounts > Account Information settings...

  • How to get change log for fields if change document flag is not maintained?

    Hi experts,
    My requirement is display the change log details for the transaction FAGLGA32.
    In this transaction we have the Field Groups block.if any change is happened for field group we need to capture the change.
    the field for the field group is RKAL1-FGFLG1 and the data element is FGFLG.
    In the data element FGFLG, the flag CHANGE DOCUMENT is not maintained.
    How to get the change log details for the fields for which the change document flag is not maintained at data element level?
    Regards,
    Ramesh

    do a modification for the data element or try Audit Trail (depends on your release)
        Audit Trail (electronic records) / Tx AUT10, AUT01, XX-PROJ-ELR, OSS 564743,517613,564645
            Note 1058984 - FAQ: Audit Trail (Transactions AUT01-AUT10)
            http://help.sap.com/erp2005_ehp_03/helpdata/DE/fc/89683c1b5fb712e10000000a114084/frameset.htm
    cheers
    carsten

  • How do you change the "From" field to have a name that you want?

    For instance, I receive sports updates from Rotoworld and ESPN. Their email addresses are '[email protected]' and '[email protected]'. Can I change this somehow? Can I change the name so that the From field show what I want it to show instead of the long email address? I would like to just have it say "Rotoworld" and "ESPN".

    if you REALLY wanted to you could edit the .elmx email file as a text file and replace the sender name there. this can of course, be automated. However, that would be wa-a-y too much trouble and is entirely not worth it.
    Message was edited by: V.K.

  • How do I change the "by" field in the iTunes Preview page for my podcast?

    The name of the podcast has changed, but it now looks like this on the iTunes preview page:
    https://itunes.apple.com/podcast/[new name]-podcast/[numbers]
    iTunes Preview
    [new name] podcast
    By [old name]
    I can't for the life of me figure out how to change the "by" part. The other information changed automatically after I updated it in the host, libsyn.

    Thanks a lot. There doesn't seem to be a way to change it in Libsyn so I thought it might have been an iTunes thing. They were very helpful when I asked them to change the slug for me earlier. I'll ask them about this too. Here's what Libsyn allows me to change:
    Edit: Found it in the Lybsin knowledge database.
    http://helpdesk.libsyn.com/index.php?/Knowledgebase/Article/View/74/9/rss-feed-s etting-the-feed-author
    RSS Feed: Setting the Feed Author
    Posted by Krystal O. on 16 November 2011 02:05 PM
    One of the most common questions received by our support team is how to change the author in iTunes to show as them instead of "unknown". This is done by updating the author tag in your RSS feed.
    Start by logging into your Dashboard and clicking on Destinations.
    A new screen will appear with a list of your Destinations along the left hand side. Click on your RSS feed.
    On this page is a text box specifically for Author, enter your Author as you would like it to appear in iTunes. You will also see the ability to input a name and an e-mail address, note that the name and e-mail address are used by iTunes should they need to contact you regarding your Podcast and are not publicized in the store.
    ?Once you have entered the information you want, just your changes. iTunes should update within a few days.

  • How can we change Non-Editable field in MM02

    Hi,
    I want to change some fields value through MM02, but they are non-changable mode (GRAY).
    Please let me know the SPRO setting, from where I can change that fields or some other option is there in SAP..
    Thanks

    Hi,
    The Fields can be made EDITABLE in the Transaction code  OMS9
    Goto the Transaction code OMS9 and enter the FIELD SELECTION GROUP of the  Field ( from drop down)
    and  in the below screen you can find the Details like
    HIDE,
    DISPLAY
    OPTIONAL
    REQUIRED
    You can check the filed as per your requirement.
    regards,
    santosh

  • How to capture changes of custom field value

    Hi
    I am the project server 2010 administrator. i have 2 columns below
    1. task finish date
    2. myfield (task level custom field)
    when ever user made changes in task finish date then "myfield" task level custom field should capture the old values
    Is this possible in PSI or Event handler or Macros

    You would need to create an event handler.
    http://msdn.microsoft.com/en-us/library/office/gg615466(v=office.14).aspx
    kashif

  • How can i change to display fields in the transaction WAE01

    Hi friends ,
    I need to change to mode ´Display´ the fields "Generation" ( Waste Generator - BPGEN ) and "Waste" ( Material That Represents the Waste - MATNR ) in the transaction WAE01. I'ts posible ?
    I looked for any settings that would allow me to do this but not found.
    Appreciate all the help they can will provide.
    Thank you.

    Hi !  Amol,
    That is true, but I need those fields are not editable since it started in the transaction WAE01.
    Let me explain because I need to do this, end users often are wrong when capturing data in the fields Generation, Generator and Waste, but if you enter the field Generation and then press <ENTER>, The Generator and Waste fields are completed automatically.
    My idea is to switch to display mode fields Generator y Waste and only allow data entry in the field Generation to avoid entry errors.
    Thank you and I would appreciate your comments !

Maybe you are looking for