• First off, welcome to SQL Server Central (SSC). This is a great community-site to learn more about SQL Server.

    brian.geregach (3/7/2013)


    I am very new to SQL Server. I have a single table database, by this I mean I have created only one table. I have columns that I think would do well holding the data in it's own table and then create a PK to FK relationship.

    What has you thinking that? This simplest case where this type of normalization typically makes sense is when you can reduce the number of rows in what becomes the primary (parent) table, i.e. when you have a one-to-many relationship between the parent table and child table. Would you mind posting the DDL for your table, i.e. the CREATE TABLE statement? You can retrieve it by right-clicking the table within SQL Server Management Studio (SSMS) and using the "Script table as" menu.

    Also, is there anything special I have to do to query the primary table to give me the data that is in the new table?

    Once you have split the one table into two and related them via a PK / FK relationship, then to bring them together again you will use a query that contains a JOIN clause, like this:

    SELECT pt.KeyCOlumn,

    pt.SomeColumn,

    ct.OtherColumn

    FROM ParentTable pt

    JOIN ChildTable ct ON pt.KeyColumn = ct.KeyColumn;

    If you're just starting out I would recommend any book from Itzik Ben-Gan. Here are two good ones, one each for SQL 2008 and SQL 2012:

    Microsoft® SQL Server® 2008 T-SQL Fundamentals

    Microsoft® SQL Server® 2012 T-SQL Fundamentals

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato