Can anyone please guide me what's wrong in this SQL Server query:
SELECT A.*, (SELECT TOP 1 B.Name FROM B WHERE Contains(B.Name,A.Name)) Name FROM A;
It seems that
A.Name is inaccessible in the query.
I want to populate a column in select query with data from another table. I can't use INNER JOIN since there isn't any FK relationship between tables.
Actually I want to insert data from
table A into another
table C, but for insert I need to populate a
NOT NULL Column in
table C, that I am trying to populate with this query
(SELECT TOP 1 B.Name FROM B WHERE Contains(B.Name,A.Name)) as column.
Any help would be really appreciated.