Easy way to Load Data into tables?

Posted on 2005-04-24
Last Modified: 2010-03-19

I wanted to know if someone can tell me the easiest way to load data into newly created tables.

Certain tables like "States", "Countries" i need to constantly reload and reload each time I create my databases.

I have maybe 10-20 tables that should have "canned" data in them when the tables are created.  I would like to have just one script that I can run that will populate the tables.

I suppose DTS could do something like this, but I was looking to have it all in one .sql file.


Question by:Westside2004
    LVL 28

    Expert Comment

    One option that you can do is to create your "canned" tables in the model database.  Once it is there, everytime you create your database, it will automatically be created in your new database.  You don't have to create any script to do this because SQL Server will do it for you.

    Hope this helps.
    LVL 28

    Accepted Solution

    Just to explain further, any object that exists in the model database will be automatically created in any new database within SQL Server.  So if you have your "States" and "Countries" table there, any new database will have these tables as well.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    The steps for moving the system databases to a new location are documented in the following technical article: However sometimes after the moving process is finished, though SQL i…
    I recently came across an interesting Question In EE ( and was puzzled about how to achieve that using SSIS out of the box tasks, which was i…
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now