Stored Procedure in T-SQL (Logic)

I am writing a SPOC and need help with the logic portion; please show examples

I need it to

1.Need a Stored Procedure that will scan the Item table for negtest items.

 2.Once they are found look up the Itemloc record and find any negative quantity on Hand records.  

3. Once found place into the test table for review in the negtest Error Processing screen.
December2000Asked:
Who is Participating?
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
>in the negtest Error Processing screen.
SP's do SQL, not UI objects such as screens, so this will likely not happen.

Also, without knowing the schema for these tables this is going to involve a lot of assumptions.

Something like...

CREATE PROC sp_foo() as

INSERT INTO YourTestTable (item_id, itemloc_id)
SELECT i.id, itemloc.id
FROM ITEM i
INNER JOIN Itemloc il ON i.id = il.item_id
WHERE i.negtest = True

GO
0
 
December2000Author Commented:
Thank you
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Thanks for the grade.  Good luck with your project.  -Jim
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.