Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

Why this TSQL syntax error?

Hi, I'm using sql 2005 express.  The sub select query runs fine when I run it by itself.  But I got the following error when I embedded it in this Insert error?  Thanks.

INSERT INTO [MedDb].[dbo].[DegreeMajor]
           ([Major Title])
     VALUES
           (select distinct degree_Major from dbo.PersonDegree pd
                  where degree_Major is not null and degree_Major <> '.' and degree_Major <> '')


Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'select'.
Msg 102, Level 15, State 1, Line 8
Incorrect syntax near ')'.
ASKER CERTIFIED SOLUTION
Avatar of enachemc
enachemc
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca
lapucca

ASKER

Thank you.