SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict mak-uk's Avatar
    Join Date
    Dec 2001
    Location
    Midlands, UK
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Converting basic MySQL design to MS SQL

    Hi

    I am a beginner and produced the following basic design of three tables in MySQL.

    What I would like to do is simply to convert this design from MySQL to MS SQL using the appropriate relevant types. Can someone please suggest them for me please?

    Any ideas?

    Thanks.

    Mak.

    -------
    PHP Code:

    mysql
    describe articles;
    +----------------+--------------+------+-----+------------+----------------+
    Field          Type         Null Key | Default    | Extra          |
    +----------------+--------------+------+-----+------------+----------------+
    articleID      int(11)      |      | PRI NULL       auto_increment |
    relAuthorID    int(11)      |      |     | 0          |                |
    relTopicID     int(11)      |      |     | 0          |                |
    articleTitle   varchar(200) |      |     |            |                |
    articleDate    date         |      |     | 0000-00-00 |                |
    articleContent longtext     YES  |     | NULL       |                |
    +----------------+--------------+------+-----+------------+----------------+
    6 rows in set (0.02 sec)[list]

    mysqldescribe authors;
    +-------------+-------------+------+-----+------------+----------------+
    Field       Type        Null Key | Default    | Extra          |
    +-------------+-------------+------+-----+------------+----------------+
    authorID    int(11)     |      | PRI NULL       auto_increment |
    authorFname varchar(50) | YES  |     | NULL       |                |
    authorSname varchar(50) | YES  |     | NULL       |                |
    authorEmail varchar(50) | YES  |     | NULL       |                |
    authorDate  date        |      |     | 0000-00-00 |                |
    +-------------+-------------+------+-----+------------+----------------+
    5 rows in set (0.00 sec)

    mysqldescribe topics;
    +------------+--------------+------+-----+---------+----------------+
    Field      Type         Null Key | Default | Extra          |
    +------------+--------------+------+-----+---------+----------------+
    topicID    int(11)      |      | PRI NULL    auto_increment |
    topicTitle varchar(200) | YES  |     | NULL    |                |
    +------------+--------------+------+-----+---------+----------------+
    2 rows in set (0.00 sec
    -------

  2. #2
    SitePoint Wizard wdmny's Avatar
    Join Date
    Jul 2000
    Location
    Here
    Posts
    1,010
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The type names are almost the same. MS SQL Server has int, varchar, text, and more. From SQL Server's Enterprise Manager you can easily add columns and select the type you need. You shouldn't have any problems in choosing the right data types for the columns you listed.

    (That paragraph is kind of short and choppy, but so are the ideas. I know it sounds goofy )

  3. #3
    SitePoint Addict mak-uk's Avatar
    Join Date
    Dec 2001
    Location
    Midlands, UK
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question but...

    Hi

    So in this case, what would I use for articleContent (the text of an article). What is a direct substitute for 'longtext' which allows 2GBs (I think.. or some large amount).

    Thanks.

    Mak.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •