Calculate rows in a tabel

  • Hello, how would I calculate rows in a tabel to G. I need to move data to the another server, 3 tabels. Each tabels contains 400,000 rows.

    Thank you

  • I would usually port the tables over using either SSIS packages, or a one shot data import via the GUI.

    Going to need more information about the 'calculation' portion of what you're looking to do though.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • I just need to move data from 1 server to another with specific criteria

  • pop up a SSIS package with a single data flow item, then put in your three OLEDB sources and destinations in the flow.

    Define your source and target server in the bottom.

    In the sources, choose 'sql query' after setting the proper source. Write up your query there.

    In the targets, just name the target tables for quick load.

    Manually run the package, confirm your data, delete the package.

    Probably the easiest way to deal with this if you work with SSIS regularly.

    If you don't, setup a linked server and necessary security, pump the data over that way.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • How can I calculate how much space will it take, for example 500000 rec = to how many gb. Thank you

  • Krasavita (11/8/2010)


    How can I calculate how much space will it take, for example 500000 rec = to how many gb. Thank you

    You need to calculate spaceused for a single row, then multiply by number of rows. There are a number of good web sites that will give you the calculations.

    sp_help TableName will give you the max space used for each column. Use of VARCHAR datatypes makes an exact size difficult. Also if you have TEXT or IMAGE datatypes thinks get complicated.

    But actually for a quick and dirty use sp_spaceused TableName. This will probably give you an acurate enough figure for most planning. If you aren't copying all rows you can approximate the % used, or go back to calculating it.

    Cheers

    Leo

    Leo
    Nothing in life is ever so complicated that with a little work it can't be made more complicated.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply