Page 78 - DCAP508_DATABASE_ADMINISTRATION
P. 78

Database Administration




                    Notes          WHERE Location=@City
                                   ORDER BY FirstName

                                   Here the placeholder i.e. Input parameter is @City variable. It acknowledges the value, sends by
                                   the caller program and implements the procedure according to it. Here, we can obtain all the
                                   Customer's First and Last Names having location values located in @City variable.
































                                   For executing, use the code given below in Query Analyzer
                                   USE TestDB
                                   EXEC Show_Customer 'Oklahoma'
                                   Here we have modified the city from "New York" to "Oklahoma" and now our stored procedure
                                   is now well generalized to return the Customers for variable cities, based on the input value.































          72                                LOVELY PROFESSIONAL UNIVERSITY
   73   74   75   76   77   78   79   80   81   82   83