creating tables in sqlserver

  • i have a table like emp table( ename ,eid,deptno,manager,eloc).dept table like (deptno,deptid,dname,dloc)

    please provide syntax for this eid is primary key

    immediate plzzzzzzzz........

  • You can check books online immediately.

    M&M

  • I agreen with mohammed moinudheen ;

    there is no shortcut for this; knowing how to use the CREATE TABLE command is one of the first steps you need to know in SQL server; it makes you familiar with data types, constriants, primary keys and so much more;

    this might help you get started:

    SQL SERVER CREATE TABLE

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • koteswararao001 (7/3/2012)


    i have a table like emp table( ename ,eid,deptno,manager,eloc).dept table like (deptno,deptid,dname,dloc)

    please provide syntax for this eid is primary key

    immediate plzzzzzzzz........

    The title of your thread talks about creating tables but the body doesn't really actually say anything at all. There is no indication of what syntax you so desperately need. Are you trying to create these two tables? Are you trying to query data from these? I have a feeling this must be homework because you have defined the columns in these two tables but don't know how to create a table.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 4 posts - 1 through 3 (of 3 total)

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