Prints error information about the error that caused execution to jump to the CATCH block of a TRY.CATCH construct. Contains the ErrorLogID value corresponding to the row inserted by uspLogError in the ErrorLog table. System Data parameter for the stored procedure uspLogError. Should be executed from within the scope of a CATCH block otherwise it will return without inserting error information. Logs error information in the ErrorLog table about the error that caused execution to jump to the CATCH block of a TRY.CATCH construct. Enter a valid ProductID from the Production.Product parameter for the stored procedure uspGetWhereUsedProductID used to eliminate components not used after that date. System Data parameter for the stored procedure uspGetWhereUsedProductID. Stored procedure using a recursive query to return all components or assemblies that directly or indirectly use the specified ProductID. Enter a valid ManagerID from the HumanResources.Employee table.ĭbo.uspGetWhereUsedProductID (stored procedure) System Data parameter for the stored procedure uspGetManagerEmployees. Stored procedure using a recursive query to return the direct and indirect employees of the specified manager. Enter a valid EmployeeID from the HumanResources.Employee table.ĭbo.uspGetManagerEmployees (stored procedure) System Data parameter for the stored procedure uspGetEmployeeManagers. Stored procedure using a recursive query to return the direct and indirect managers of the specified employee. Enter a valid date.ĭbo.uspGetEmployeeManagers (stored procedure) Enter a valid ProductID from the Production.Product parameter for the stored procedure uspGetBillOfMaterials used to eliminate components not used after that date. System Data parameter for the stored procedure uspGetBillOfMaterials. Stored procedure using a recursive query to return a multi-level bill of material for the specified ProductID. The message text of the error that occurred.ĭbo.uspGetBillOfMaterials (stored procedure) The line number at which the error occurred. The name of the stored procedure or trigger where the error occurred. The state number of the error that occurred. The error number of the error that occurred. The user who executed the batch in which the error occurred. The date and time at which the error occurred. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY.CATCH construct. Nonclustered index created by a primary key constraint.Īudit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY.CATCH construct. The raw XML data generated by database trigger. The exact Transact-SQL statement that was executed. The object that was changed by the DDL statment. The schema to which the changed object belongs. The type of DDL statement that was executed. The date and time the DDL change occurred. Version number of the database in 9.yy.mm.dd.00 format.ĭate and time the record was last updated.Ĭlustered index created by a primary key constraint. Object TypeĬurrent version number of the AdventureWorks sample database. Try it with your next example it may save you a lot of time.Primary filegroup for the AdventureWorks sample database. Instead of spending hours on creating sample databases, I will use the AdventureWorks database whenever I need just a database for my samples. To navigate around you should download the AdventureWorks OLTP Database Diagram for Visio: The file size is small, but there are many tables inside this database. Extended data warehouse (DW_Ext): with a lot more data (883 MB).Lightweight (LT): with a smaller set of data (7 MB).You can download a backup of the database for your version of SQL Server as part of the SQL Server Samples Repository. Thanks to the liberal license ( MIT license), you are allowed to use this database for whatever you like. With nearly 20.000 customers, over 70.000 orders and 500 products there is enough data for your examples. That stopped a few releases ago, but the database still does exist. Microsoft created a long time ago the fictitious multinational manufacturing company called Adventure Works and shipped the AdventureWorks database as part of SQL Server. They would work with any table, as long as there is just enough test data. However, most examples do not require handcrafted tables. The more time I spend with the setup, the less time I have to write the blog posts. Whenever I want to explain something that requires a database, I have to spend a lot of time to create the tables and test data before I even can start with the part I want to show.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |