• you are using invalid sintax. Try:

    CREATE TABLE #Company(companyIDintNOT NULL IDENTITY(1,1)

    ,recnumintNOT NULL

    ,nameFormalnvarchar(100)NOT NULL

    ,parentnvarchar(100)NULL

    ,recnumParentintNULL

    ,sourceRefnvarchar(100)NOT NULL

    ,commentsnvarchar(1000)NULL

    ,createdBynvarchar(3)NOT NULL

    ,createdDatedateNOT NULL

    ,numEmplsintNULL

    ,emfValidThisCompanychar(1)NOT NULL CHECK (emfValidThisCompany IN('Y', 'N'))

    ,nameInternal AS LOWER(CASE WHEN nameFormal LIKE 'the %' THEN SUBSTRING(nameFormal,1,LEN(nameFormal)-4) ELSE nameFormal END)

    PRIMARY KEY(companyID)

    );

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]