runswithsizzors
Well-known member
I have a database that the first row is a default row, then when a new entry to a database is created I need to copy this row and create a duplicate row in the same table.
This stored procedure is called every time a new project is create. Each project has a default area with an area code of 1. The keys in the database is project code and area code. Single area's can be assigned to multiple projects
This is what I have and maybe it is an easy fix:
INSERT INTO project_areas (project_code, area_code, area_name, county, township, section, town, range)
SELECT @project_code, M.area_code, M.area_name, M.county, M.township, M.section, M.town, M.range
WHERE M.area_code = @area_code
The parameters of the stored procedure is the new project code and then 1 for the area code.
Is there another way to do this or am I clueless, thanks all that reply!
This stored procedure is called every time a new project is create. Each project has a default area with an area code of 1. The keys in the database is project code and area code. Single area's can be assigned to multiple projects
This is what I have and maybe it is an easy fix:
INSERT INTO project_areas (project_code, area_code, area_name, county, township, section, town, range)
SELECT @project_code, M.area_code, M.area_name, M.county, M.township, M.section, M.town, M.range
WHERE M.area_code = @area_code
The parameters of the stored procedure is the new project code and then 1 for the area code.
Is there another way to do this or am I clueless, thanks all that reply!