Yes, variables is the problem, you learn every day. The I guess I have a problem here.
The number of rows to be inserted by the trigger varies so I don't know how to do this without using variables.
DECLARE @id nvarchar(20)
DECLARE @dt int
DECLARE @nv int
DECLARE @i int
Select @id = ID FROM INSERTED
Select @dt = DEVICETYPE FROM INSERTED
Select @nv = NOOFVALUES FROM DEVICETYPES WHERE @dt = DEVICETYPE
Set @i = 1
WHILE @i <= @nv
INSERT INTO dbo.DEVCHANNELINFO (ID_DEVICE,VALUEINDEX,OFFSET,COMMENT) VALUES (@id,@i,0,'')
Set @i = @i + 1