I this was already solved, please mark so. Otherwise here is variation of the same:
CREATE TABLE #TABLE (
employeeid VARCHAR(10),
projectid VARCHAR(10)
,num1 INT
,num2 INT
)
DECLARE @SqlQuery NVARCHAR(4000);
SET @SqlQuery=' INSERT INTO #TABLE SELECT TOP '+CAST(@no_of_rows AS CHAR)+'tblEmployee.id ,
tblProject.ID, 0,0
FROM tblBilling (NOLOCK) '
EXEC(@SqlQuery)
please close thread if this or earlier solution has worked