Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To choose data FROM a stored procedure, you can use the following steps:

  1. Open a new query window in SQL Server Management Studio.
  2. Create the stored procedure and save it.
  3. Write a SELECT statement that calls the stored procedure and specifies its parameters, if any.
  4. Execute the SELECT statement to retrieve the data from the stored procedure.

For example, if you have a stored procedure called "GetCustomers" that takes no parameters and returns a list of customers, you can choose data from it using the following SELECT statement:

EXEC GetCustomers;

If the stored procedure takes parameters, you would specify them in the SELECT statement, like this:

EXEC GetCustomers @City = 'New York';

This would return a list of customers from the "New York" city.