I'm attempting to write a stored procedure that will have two parameters.
- ComputerName | nvarchar
- Monitor_Serial | Table-valued parameter (TVP)
I'm using a TVP because some computers have an unknown number of monitors.
I would like my stored procedure to take each serial number in the
Monitor_Serial and insert a new line in my table with the associated
ComputerName (exactly how a foreach loop would work in programing).
How would I do this? When I was doing some research I saw the use of a cursor mentioned a few times but I'm not sure if this is what I should be using. Any suggestions would be greatly appreciated.