The errors I got when trying to run this, and how I fixed each one:
1. Invalid object name 'tbl_ItemGroup' (et al)
This is entirely down to the way you have described your problem. I foolishly assumed you had used the real table names when you gave the schema. I had already created the tables so any sql posted below will be missing the "tbl_" on the table names.
2. The multi-part identifier "t1.ItemGroup_id" could not be bound.
Again, down to the schema you provided. In any sql below that column will be called Group_id
3.
The correlation name 't3' is specified multiple times in a FROM clause.
This is a real problem. You can't use the alias
t3
twice. So you either meant
Inner JOIN ItemCreation t3 on t3.ItemCreation_Id=t1.Group_Id
Inner Join ItemCreation t4 on t4.ItemCreation_Id=t2.Unit_Id
or probably more likely meant
Inner JOIN ItemCreation t3 on t3.ItemCreation_Id=t1.Group_Id
AND t3.ItemCreation_Id=t2.Unit_Id
4. The multi-part identifier "t1.Group_Id" could not be bound.
At first I thought this was just down to the differences between the schema and the query you posted but then I spotted that you hadn't joined to
Unit
correctly
You need to use JOIN rather than the old syntax you have used. Otherwise you will need a WHERE clause to define how Unit should link to one of the other tables. So I looked again at the lines I mentioned in point 3 and concluded that what you actually meant was
INSERT INTO ItemCreation
SELECT @Item_Name,@Item_Code,t1.Group_Name,t1.underGroup ,t2.unit_Name
FROM ItemGroup t1
Inner JOIN ItemCreation t3 on t3.ItemCreation_Id=t1.Group_Id
inner join Unit t2 on t3.ItemCreation_Id=t2.Unit_Id
5. Not a syntax error here but you have no WHERE clause on this query - which means it is going to insert a new row for every row that is already on the table - I'm not sure that's what you really want to do either.
Get your errors fixed and try running your query several times. Check the behaviour is really what you want. If not then by all means come back with some sample data and an expected result.