whole idea of giving this code is there I want to use in exec command inserted whereas when I use this way it says inserted is not object
CREATE TRIGGER tr1 ON [dbo].[Table1]
FOR INSERT
AS
declare @temp nvarchar(175)
declare @tbl nvarchar(15)
select @tbl ='Emp'
declare @rno int
declare @xx int
select @rno =recordnumber from inserted
select @xx =recordnumber from @tbl where name='abc'
declare @xx1 nvarchar(5)
declare @rno1 nvarchar(5)
select @xx1 =convert(nvarchar(5),xx1)
select @rno1=convert(nvarchar(5),rno1)
select @temp = 'select convert(nvarchar(5),level) from '+@tbl +' join inserted on '+@xx1+' = '+@rno1
EXEC( @temp)
CREATE TRIGGER tr1 ON [dbo].[Table1]
FOR INSERT
AS
declare @temp nvarchar(175)
declare @tbl nvarchar(15)
select @tbl ='Emp'
declare @rno int
declare @xx int
select @rno =recordnumber from inserted
select @xx =recordnumber from @tbl where name='abc'
declare @xx1 nvarchar(5)
declare @rno1 nvarchar(5)
select @xx1 =convert(nvarchar(5),xx1)
select @rno1=convert(nvarchar(5),rno1)
select @temp = 'select convert(nvarchar(5),level) from '+@tbl +' join inserted on '+@xx1+' = '+@rno1
EXEC( @temp)