Results 1 to 2 of 2

Thread: sql question

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    9
    why cant i create this table ????
    USE amit

    IF OBJECT_ID('dbo.member_details') IS NOT NULL
    DROP TABLE dbo.member_details

    GO

    CREATE TABLE member_details
    (
    member_id int NOT NULL constraint member_id_no primary key
    , member_name name NOT NULL
    , member_rigion char(2) NOT NULL constraint member_rigion check (member_rigion like '(ta) , (ha) , (aa) , (by)')
    )

    GO


    SELECT table_name
    FROM information_schema.tables
    WHERE table_name = 'member_details'



    Server: Msg 2715, Level 16, State 7, Line 2
    Column or parameter #2: Cannot find data type name.
    table_name
    --------------------------------------------------------------------------------------------------------------------------------

    (0 row(s) affected)




  2. #2
    New Member
    Join Date
    Jul 2000
    Posts
    13

    Just an educated guess


    I'm no SQL expert, but I don't believe that "name",
    is a proper data type. In the following line of your code :

    member_id int NOT NULL constraint member_id_no primary key
    , member_name name NOT NULL
    , member_rigion char(2) NOT NULL constraint member_rigion check (member_rigion like '(ta) , (ha) , (aa) , (by)')

    You define member_id as an int, member_region as a char(2)
    but define member_name as name, not something like varchar.
    I use Oracle and Access 2000 and haven't ever used or saw name used as a data type, but it could very well be ok. Like I said, this was just an educated guess based on the error you displayed.


Posting Permissions

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



Click Here to Expand Forum to Full Width