![]() ![]() The first problem was that you can, from a batch, receive only one result from a stored procedure, and that is by using a rather nasty EXEC.INSERT syntax. What’s more, you don’t have to be too attentive to changes in the data model just as long as you keep the stored procedure in step, so that it continues to work in the same way for the application. You can receive as many results as you want, pass values to and fro in parameters, check the return code and read the message stream. It should have been called a stored batch calling it a ‘procedure’ inflated programmers’ expectations too much.Īs in interface component, called by the application, stored procedures work very well. The stored procedure improved on this by providing parameters, storing the batch on the server in compiled form, from where it could be invoked by name. The application had to throw the batch together as ‘ad-hoc’ or ‘dynamic’ SQL and execute it, receiving one or more results. It wasn’t recursive, and wasn’t parameterized it was just a unit of work. ![]() In the beginning was the SQL batch, merely a sequence of SQL queries and statements. Nothing quite works the way that your IT education would lead you to expect. ![]() If you use a stored procedure in the same way as a procedure in any other language, you soon end up in the jungle. They are an essential if somewhat dangerous part of the Sybase and SQL Server landscape, rather like a volcano, bog or swamp. It is an exaggeration to say that I like stored procedures. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |