```
ALTER TRIGGER t1
ON dbo.Customers

FOR INSERT
AS

BEGIN TRANSACTION

/* variables */

DECLARE
    @maxid bigint

SELECT @customerid = id FROM inserted

SET IDENTITY_INSERT dbo.new_table ON

DECLARE
    @maxid bigint

SELECT @maxid = MAX(ID) FROM new_table

INSERT INTO new_table (ID, ParentID, Foo, Bar, Buzz)
    SELECT ID+@maxid, ParentID+@maxid, Foo, Bar, Buzz FROM initial_table

SET IDENTITY_INSERT dbo.new_tableOFF

/* execute */
COMMIT TRANSACTION

GO

```

fails with:

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

How to fix it?

What I am trying to do is

* insert `id` and `parentid`, each INCREASED by `@maxid`
* from `initial_table`
* into `new_table`

thnx

**new\_table**

```
id (bigint) 
parentid (bigint - linked to id) 
foo | bar | buzz (others are nvarchar, not really important)

```

**initial table**

```
id (bigint) 
parentid (bigint - linked to id)
foo | bar | buzz (others are nvarchar, not really important)

```