Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

subquery returned more than 1 value on an insert into

$
0
0

I have a simple query to insert data from one table to another and I am expecting multiple rows to be inserted but I get an error about subquery returned more than 1 value. When I change the is not null to a specific row, it inserts just fine. What do I need to change to make this run properly. TIA

 

QUERY

 

GO

INSERT

INTO tbl_client (client_name, client_number)

(

SELECT client_name, Client_ID AS Client_Number from CLSQL01.SJDOCS.DOCSADM.CLIENT WHERE Client_ID isnotnull)

GO

 

ERROR

 

 

Msg 512, Level 16, State 1, Procedure TR_Client_Insert, Line 3

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

The statement has been terminated.

 

 

 

 

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>