varbinary(max) field in sql server 2005 problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kunalk
    New Member
    • Mar 2010
    • 1

    varbinary(max) field in sql server 2005 problems

    Code:
    CREATE TABLE Upload
    (
    uploadid INT IDENTITY(1,1) PRIMARY KEY,
    cssid INT NOT Null FOREIGN KEY REFERENCES CourseSemSub(cssid),
    teacherid VARCHAR(10) NOT NULL FOREIGN KEY REFERENCES Teacher(teacherid),
    description VARCHAR(40),
    video VARBINARY(MAX) NOT NULL
    )
    I'm unable to execute the above create table statement. It is giving the following error.
    Msg 170, Level 15, State 1, Line 7
    Line 7: Incorrect syntax near 'MAX'.

    Details:
    Upload is the table in my database & CourseSemSub, Teacher are the two other tables earlier created.
    I want to store video files in the video field in this Upload table. So i'm trying to make it varbinary(max)[as large as possible] but i'm unable to create the table using above code.
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Weird, if I remove the FK's this query works fine...Can you post the full creation code for the complete database?

    Steven

    Comment

    Working...