July 16, 2017 at 8:22 pm
INSERT INTO dbo.mixedwords (Mixed, MixLen, GoodVa)
Values ( SELECT DISTINCT LTRIM(RTRim(mixVa) as NewTerm
, MixCnt
, ValidVal
FROM Sandbox
)
Note: All objects are spelled correctly
The SELECT query runs if highlighted and executed
July 16, 2017 at 9:48 pm
Try without Values and the brackets (), after the INSERT INTO line just have the select statement.
July 17, 2017 at 1:42 am
As vulpes said, when using Select in that format, you don't use values. Your SQL should be in the format:INSERT INTO [DestinationTable] ([List], [of], [Column], [Names])
SELECT [List], [of], [Column], [Names]
FROM [SourceTable]
{WHERE...};
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
July 17, 2017 at 7:17 am
sandyshin 42844 - Sunday, July 16, 2017 8:22 PMINSERT INTO dbo.mixedwords (Mixed, MixLen, GoodVa)
Values ( SELECT DISTINCT LTRIM(RTRim(mixVa) as NewTerm
, MixCnt
, ValidVal
FROM Sandbox
)
Note: All objects are spelled correctly
The SELECT query runs if highlighted and executed
A missing closing parenthesis here, too: LTRIM(RTRim(mixVa)
Not sure how it would still run if you just highlighted it and executed it.
July 17, 2017 at 7:27 am
INSERT INTO dbo.mixedwords (Mixed, MixLen, GoodVa)
SELECT DISTINCT LTRIM(RTRim(mixVa)) as NewTerm
, MixCnt
, ValidVal
FROM Sandbox
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply