TAILIEUCHUNG - Microsoft SQL Server 2008 R2 Unleashed- P96

Microsoft SQL Server 2008 R2 Unleashed- P96:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 894 CHAPTER 28 Creating and Managing Stored Procedures -- Processing goes here RETURN If you want to help identify the data values for which the parameters are defined it is recommended that you give your parameters meaningful names. Parameter names like local variables can be up to 128 characters in length including the @ sign and they must follow SQL Server rules for identifiers. Up to 2 100 parameters can be defined for a stored procedure. When you execute a procedure you can pass the parameters by position or by name --Passing parameters by position EXEC myproc 1 2 3 --Passing parameters by name EXEC myproc @parm2 2 @parm2 1 @parm3 3 --Passing parameters by position and name EXEC myproc 1 @parm3 3 @parm2 2 After you specify one parameter by name you must pass all subsequent parameters for the procedure in that EXECUTE statement by name as well. You cannot pass any of the subsequent parameters by position. If you want to skip parameters that are not the last parame-ter s in the procedure and have them take default values as described in the next section you also need to pass parameters by name or use the DEFAULT keyword in place of the parameter value. TIP When you are embedding calls to stored procedures in client applications and script files it is advisable to pass parameters by name. Reviewing and debugging the code becomes easier that way. One time we spent half a day debugging a set of nested stored procedures to figure out why they weren t working correctly only to find the problem was due to a missed parameter all the parameter values were shifted over one place and the wrong values ended up being passed to the wrong parameters. This resulted in the queries not finding any matching values. Had the parameters been passed by name this issue would not have occurred. This was a lesson learned the hard way Input parameter values passed in can be only explicit constant values local variables parameters or new for SQL Server 2008 table-valued parameters. .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.