Copying tables along with their indexes between databases

I use sql server management studio express.  I have a database that has some questionable schemas, roles, etc, so I decided to create a new database, with just tables, stored procedures, and user-functions.
So I used the "import data" feature, which allowed me to select several tables, that were copied along with their data.
Then, I scripted out all the user-functions and stored procedures from the original database, and pasted them into a query window for the new database, and executed the create statements for each.
Then I got a message that I was lacking a full-text index.
I then started examining some tables, and even regular tables with an integer primary key that is supposed to be an identity' field were not identity fields any more, and lacked the auto-increment.
I tried to change that, and make them auto-increment, and then sql server told me that I can't do that.  I guess if there is already data inside an integer field, you can't make it auto-increment.
So how do I solve all this?
Thanks

You cant modify a column to be of type identity. For that you need to do the below
http://www.mssqltips.com/sqlservertip/1397/add-or-drop-identity-property-for-an-existing-sql-server-column/
But in your case what works best would be to script out the table along with identity and then use it to create the table in the new database.
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • Is it possible to export full PCD object list along with their PCD ID?

    Hi
    Is it possible to export full PCD object list along with their PCD ID to an excel sheet or txt file?
    Any help will be appreciated.
    Regards
    Vineet

    Hi,
    I have provided a simple method below to Get all the PCD objects PCD  ID.
    1. Create a transport package.
    2. Add all the PCD objects for which ever you need the PCD ID.
    3. Now release the Transport package as the "File system" mode.
    4. Once it is done successfully, it will display all the transported object and its corresponding PCD ID in a table format.
    You can simply copy and paste it in a excel to get the PCD ID for the PCD objects.
    Hope this is helpful.
    Thanks,
    Mahendran B.

  • Unique file name to be decoded and to be updated in a table along with data

    Hi
    I'm working on a File to Proxy scenario, where the file names(10 chars length) are unique. These files will be available for XI in a source directory. My requirement is -- file name need to be decoded into 3 values and to be updated into a r/3 database table along with the file data.
    Hope my requirement is clear.
    Thanks.

    You cannot see the field which stores the file name. The file name comes from payload at runtime.
    Secondly no need to create any input parametes in your UDF, just edit your udf and delete the input parameter (default input is 'a') so that you don't have to map any constant to this UDF just map this UDF to target field.
    e.g. UDF ---> target Field.
    I did the same but am not able to activate the mapping.
    Mapping activation Error:
    Activation of the change list canceled Check result for Message Mapping hello_mapping | http://briks.com: 
    Mapping not sufficiently defined
    Chennai.

  • How to copy the content in XMLtype column between databases

    Hi, there,
    Does anyone know how to copy the content in XMLtype clumn between databases? I tried insert as select via database link and it gives me the following message:
    SQL> insert into nrt_ot_request_temp (SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML )
    2 select SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML from nrt_ot_request@nrtdb_acacia;
    select SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML from nrt_ot_request@nrtdb_acacia
    ERROR at line 2:
    ORA-00942: table or view does not exist
    Thanks,
    Jessica

    Hi Jessica,
    in my eyes the second statement
    select ... xmlstring_column ... from table@remote_side;
    causes the error. Columns of type XMLString internally are stored as CLOBs in Oracle. Unfortunately there are restrictions on statements for CLOBs and remote locators.
    It seems you cannot say
    SELECT clob_column FROM table@remote_site;
    Remark: For me this is a showstopper for the datatype XMLString if you cannot run a simple statement like this one. It seems you can do an insert and an update but no select.
    On the other hand your first statement
    INSERT INTO table_local SELECT * FROM table@remote_site;
    should work following the documentation.
    See also
    http://docs.oracle.com/cd_a97630/appdev.920/a96591/adl04mng.htm#98328
    Best regards
    Indu Keilitz

  • Retrieve all column data of a table along with the number of records received

    hi, i want to select all the records from a table along with the number of records received as i need to use that number in a loop  to retrive data from another table
    can i use 
    SELECT @emp_id=emp_ID, @emp_NAME=emp_NAME,@RowCnt = (select count(*) from emp_id) order by emp_id

    i tried your idea, i get error in at the over() . I am using sql compact edition and i guess it is not supporting over() function. But i am still going to use the code for example something like this assuming it will work in real time with
    enterprise edition. Please let me know what i am going to use is correct or not?
    SELECT [EventID],[BallroomCharge], @rowcnt=count(*) Over()
    FROM [testSample].[dbo].[Events]while (@rowcnt > 0)perform some request

  • Data Display table along with Graph

    As per my knowledge we are not having any option currently for displaying data table along with graph.
    This plot data table can have plot name along with current data.
    See the sample below. Many times I need to display number of parameters on graph and current value need to see along with graph.
    It will very useful if I get something like this in next version.

    Hi chameli,
    well, you gave the chart as an example to your question - but didn't specify your question any further!
    What's wrong with a little coding to have your data presented as you like to?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Extraction of Contexts along with their joins in Designer

    Post Author: sachinj
    CA Forum: Deployment
    Hi All,
    In designer, how can one extract the context along with it's relevant joins ?
    I tried File>Save As>Save as type changed to pdf. But the pdf does not give the contexts along with their respective joins.
    Does any one have solution to this one ..Thanx in advance.
    With Regards
    Sachin

    Hi,
    youa can use these two datasources:
    2LIS_11_VAKON                  Sales Document Condition     
    2LIS_13_VDKON                  Billing Document Condition   
    hope this helps...
    Olivier.

  • How to retrieve all the users along with their password from LDAP

    Hello,
    Can anyone let me know how to retrieve and list all the user along with their password from LDAP.
    Thanks

    Hi Prashant,
    I have limited experience with Synchronization, but I agree with you - if you need to synchronize Passwords, you need to have the Password in clear Text.
    If you trying to build your own Synchronization Solution using any of the avaliable LDAP APIs, I don't think you can ever retrieve a user's Password in clear text.
    However, I did come across an interesting article & I hope you find it useful :-
    http://www.oracle.com/technology/obe/obe_as_10g/im/configssl/configssl.htm
    I am not sure if SSL is necessary - If you have a look at Metalink Note 277382.1 ( How to Configure OID External Authentication Plug-In for Authentication Via Microsoft Active Directory (MS AD) ), teh question asked by oidspadi.sh for the same is asnwered as "N".
    Regards,
    Sandeep

  • How to export Tables along with Data and also Tables without data

    Hi All,
    I have a strange situation here. I have a 2 existing schema's under one database. Now the client wants to have 4 more schema's to incorporate the new branches of his company.
    I want to know whether is it possible for me to run an expdp command by which i can have the data from the mentioned tables and only table structure of the remaining along with remaining database objects (procedure,functions,triggers,views,sequences etc).
    Since there are some 32 Master tables, whose data i need to capture in db dump in order to run the batch under new schema and the remaining tables will be populated with data from the new branch employees hence the need is for table’s structure only.

    Hi,
    you should run two different import comand.
    The first import with only metadata, just to recreate the structure.
    With the second import you will import data only for the tables you need.
    I think this is the simplier solution.
    Acr

  • Export Table along with Link Files

    Moved from 1.6 to 2.0.
    Exported my application from 1.6 and imported it into 2.0 - used "Application Export" feature - works fine.
    Exported most of my tables from 1.6 to 2.0 - used "Table Export" feature - works fine.
    Problem, I have certain Tables that reference/link to "uploaded files". These are PDFs, SLS and other files - now referenced/linked by these Tables. How do I move over these tables and their linked/uploaded files?

    Maybe this should have been posted with a title of Backup Process.
    We had a server running 10.1 and HTMLDB 1.6. We installed another server and put 10.2 on it with HTMLD 1.6. We couldn't move over everything because we were going from 10.1 to 10.2 -- so we moved over the tables -- this was recommended by Oracle.
    Our tables came over ok but those tables that had attachments/links/uploads in them came over without the attachments/links/uploads. In their place came cryptic references(pointers?) but not the attachemnts.
    Our end game here is to have 2 servers so that if one fails then we can use the other server. We are now upgrading both servers to 10.2. When both servers have 10.2 we will stop upgrading (for a long time) the database. The database had to be upgraded because of a bug in the Enterprise Manager Backup Process.
    We will want new versions Applcation Express/HTMLDB. We would upgrade both machines to keep them compatable.
    Maybe there is utility (that we can comprehend) that allows us to Export tables with attachments from one server and Import them with their attachments into the other server. Or, maybe going forward we should not try to move tables with attachments using Application Express export utilities but move over workspaces or schemas or something.

  • How export one table along with data from one location to other location

    Hi All,
    I'm new in export/import practice.
    Can anyone plz tell the steps along with commands to do the following:
    1. I want to export a table with data from one location(computer) to other(computer) that are in same network.
    2.Also from one user to another user.
    I'm using oracle 10g.
    regards
    Sonia
    Edited by: 983040 on Feb 19, 2013 11:35 PM

    First of all read documentation
    Oracle Export/Import : http://docs.oracle.com/cd/B19306_01/server.102/b14215/exp_imp.htm
    Datapump Export/Import : http://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_overview.htm
    If you are using Datapump or Traditional Export/import you need to follow following steps
    *1) Take User dump via EXPDP on Computer A .*
    For EXP
    exp username/password owner=Test file=D:\test.dmp log=D:\test.log
    For EXPDP
    expdp username/password schemas=TEST directory=TEST_DIR dumpfile=TEST.dmp logfile=TEST.log*2) Copy that to Computer B*
    *3) Import dumpfile.*
    For IMPDP  Use remap_schema optionhttp://www.acehints.com/2012/05/data-pump-impdp-remapschema-parameter.html
    For IMP use fromuser and touser option
    one user to another user imp

  • How export one table along with daya from one location to other location

    Hi All,
    I'm new in export/import practice.
    Can anyone plz tell the steps along with commands to do the following:
    1. I want to export a table with data from one location(computer) to other(computer) that are in same network.
    2.Also from one user to another user.
    I'm using oracle 10g.
    regards
    Sonia

    Wrong forum. This is a database query not an Oracle Secure Backup issue.
    Thanks
    Rich

  • How to activate the transparent table along with append structure

    Hi,
    I add the new fields in existing append structure on tale VBAP.
    Initially i provide them the data type as Char with length 20.
    Similarly i added the fields in user exit on scree 8459 to add fields on screen.
    Until this eveything was working fine.
    Then my functional consultant ask me to delete one field from structure and change the length of other data types to 40 characters.
    I done this changes but when i go to activate that append structure its giving me error that certan structures in which it is been used are not adjusted and activated.
    The table is not adjusted through SE14 - Database Utlity.
    Its showing me that Runtime Object and Transparent table are different and not consistent.
    Can i delete the runtime object?
    The domains which i ave changed are also not geing activated.
    Suggest me the node of problem and solution also.
    What should be the problem.
    What should i do to solve the problem.
    Suggest me the solution if any.

    Give a trail that instead of activating all together, activate low-level objects (domains, data elements etc)first and then high levels (structures, tables) individually. With this approach you could find the errors easily and can resolve quickly.
    Regards,
    Prasanth

  • How to get all parameter names along with their values in stored procedure which is being executed

    Im using sql server 2012, is there any possible way to get all the parameters of a stored procedure along with the values passed to it.
    I need these things to build a xml. I mean this should happen in the procedure which being executed and it should be common for all the procedures.
    For example, let us suppose we have to procedures,
    uspSave, @name='test' @age=20
    uspDelete @id=2
    now in uspSave procedure, i need to get @name, @age and the values 'test', 20 and in uspDelete, i should get @id with value 2.
    For getting the column names, i tried this,
    select parameter_name from information_schema.PARAMETERS where specific_name=OBJECT_NAME(@@procid)
    now is it possible to loop through the result of above query and can we get the values.

    I think  you need running SQL Server Profiler to capture this info even in SQL Server 2012.
    Best Regards,Uri Dimant SQL Server MVP,http://sqlblog.com/blogs/uri_dimant/
    Blog : MS SQL Development and Optimization
    Blog : Large
    scale of database and cleansing

  • Backing up selected folders along with their metadata

    My Podcast folder in the itunes Music folder has grown up to 15 GB and I need to free up some space.
    Is there a way I can just move out a portion of this folder (or any folder for that matter) along with its metadata. and then easily have it back in my library at a later stage.
    And if I move out some podcast series all together, will the subscription remain intact?

    The easiest solution is to move your entire library to a new location, but if you want to do a partial move use either the XML editing or Symbolic linking methods. I've copied below from an earlier (slighty Windows-centric I'm afraid) posting on this topic.
    *Moving your iTunes Music folder*
    OK, so you’re running out of room on your main hard drive for all that music you’ve ripped from your CD’s – it’s time to relocate some or all of the library to another drive, e.g. a nice chunky USB external drive. You could give iTunes total control – see Moving your iTunes Music folder (Mac) - and ask it to "consolidate" your library onto your new drive, letting it rename your files in the process. However I like to be in control, for example I want to keep all my classical & comedy tracks in separate folders and I don’t want my track names truncated. I also don't necessarily want to move all my library to the external drive – just the stuff I play less often so that it's not the end of the world if I've taken the drive into work. You could try and manually delete, move & re-import sections of your library. The downside is that it takes ages and you will lose any related metadata such as play counts, last played, date added, playlist membership etc. Another approach is given here: HOWTO: Move your iTunes music while preserving library data (when you don’t let iTunes manage your music library) but that involves a lot of messing about with XML and when iTunes gets around to rebuilding your library it will probably want to reprocess all the artwork & gapless playback information. Also each of the above methods will probably result in iTunes deciding that your files have "changed" in some way and so need to be resynced to the iPod, wasting yet more time.
    There is an easier way... use symbolic links or junction points. These are little known features of the NTFS & HPFS filing systems that let you take an empty folder and instead of filling it with content you make it point to existing content in another location such as an external drive. Although Mac OS X, Windows XP & Vista all support symbolic links none appear to come with any tools to help you create them so you'll have to grab something from the net. For Windows XP I've plumped for Junction Link Magic but you should explore the concept a little before diving in so you might find another tool that suits you better. Once you've got and tested a linking tool just move a section of your library (or all of it if so inclined) to a new location with enough room for it, create a blank folder to replace the folder you've just moved, then fire up your linking tool to connect the empty folder to the new destination. Once done, as far as iTunes or any other applications are concerned your music is where it always was... however your main data drive should now have loads of extra space. Job done!
    A final word of caution. Don't forget what you've done and start deleting what might appear to be duplicate files. In my case my Comedy folder is now at both D:\My Documents\My Music\Comedy (where iTunes expects to find it) & H:\Music\Comedy (the true physical location) however there is only one set of files and deleting from either apparent location will delete from both. Deleted files from such locations may also be immediately deleted rather than going to the recycle bin from where they could be recovered so a little more thought should be given to deleting files.
    tt2

Maybe you are looking for