Home Forums SQL Server 2008 SQL Server 2008 - General how ro create a table with multiple coloumns defined to a single primary key RE: how ro create a table with multiple coloumns defined to a single primary key

  • First, download the documentation. It is called "books online". Search with google books online for your version of sql server. This is example for SQL 2008R2 (put that in google):

    sql 2008R2 books online download

    First result is at Microsoft site. Download and install.

    When you are in query editor of SQL Server Management Studio, you can press F1 when text cursor is the keyword or function you want the details on. CONVERT function is the one that I use F1 the most, so I have marked that page as "Favorite" to be easily accessible.

    How to read T-SQL command syntax specification:

    http://msdn.microsoft.com/en-us/library/ms177563.aspx

    In short:

    [abc] = means that "abc" (anything within brackets) is optional, you can omit it

    {a | b | c } = means that contents of curly brackets is NOT optional. You HAVE TO select exactly one of the values that are separated by "|". E.g: a or b or c.

    [{a | b}] = that means you have to select a or b or nothing. It is the same as [ a | b ]

    {a | b}[,...n] = "[,...n]" means you can repeat that thing before as many as you like, as long as you separate them with comma. E.g: a,b,a,a,b,b,b,b

    <something> = contents of "something" is described somewhere else, usually in the same page just below.

    Try to explain this:

    CREATE TABLE

    [ database_name.[ owner ] . | owner. ] table_name

    ( { < column_definition >

    | column_name AS computed_column_expression

    | < table_constraint > } [ ,...n ]

    )

    Try to find function reference and read about all the functions that are built-in in sql server and try to use each in example. That's a good start.

    Good luck!

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths