Not sure what your question here is...but you could create that procedure with
CREATE PROCEDURE dbo.spGetNonVendors
AS
BEGIN
Select AccountID, FirstName, LastName, email
from tblCustomers Where AccountID not in (select AccountID from tblVendors)
END
See here for syntax for created stored procedures:
http://msdn.microsoft.com/en-us/library/ms187926.aspx
As for how to get the output, you should know there are actually three different sources of output from a stored procedure:
- Output parameters
- Result sets
- Messages
If you look at the docs on the page I referenced, you'll see how to declare output variables. Those are good for single values, but not what you're looking for here.
Result sets are just any select statement you happen to run while in the procedure. As you've seen from the answers here, there's nothing special to do, just execute the select.
Finally, the message output contains error messages, print statements, etc.
Now how you get to your select output depends on your client. How are you connecting to sql server and executing the procedure? If you're using Sql Management studio, you'll see the two tabs for result sets and messages. If you're using C#, a SqlDataAdapter or SqlDataReader will automatically be reading from your result sets.