SlideShare una empresa de Scribd logo
1 de 12
.NET Portfolio

Frank Rodenbaugh
ContactMe@FrankRodenbaugh.com
(724)747-8154
Table of Contents
•   Library System Overview
•   Design Highlights
•   Windows Form Sample
•   ASP.NET Web Form Sample
•   ADO.NET Code Sample
•   Stored Procedure Sample
Library System Overview
• Introduction:
    – I designed and implemented a library system to handle day-to-day
      operations performed by librarians.

• Audience:
    – Librarians will be the primary users of the applications.

• Project Goals:
    – Design and develop Windows and Web based applications that allow
      librarians to add adult and juvenile members, check in and check out
      books, and maintain an inventory of the library’s books.
    – Develop code that is easily maintainable.
    – Provide validation for all required fields.
    – Provide error handling
    – Produce a user interface that is intuitive, requiring minimal training for users
      while minimizing resource utilization
Design Highlights
• 3 Tiered Architecture
• User-friendly interface developed using MDI forms with
  menu strip navigation and ASP.NET Web forms using Tree
  View navigation
• Business ruled and validations encapsulated within the
  Business Tier
• ADO.NET Data Access called Stored Procedures in the SQL
  Server Database
• Data transported between the layers using Entities and
  Strongly-Typed Data Sets
Windows Form Sample




 Data entry screen
 Flags input format errors
 Requires a valid Adult Member Sponsor
Windows Form Sample




 Lists books on loan in a Data Grid View
 Allows check out of books
 Non-modal confirmation message
ASP.NET Web Form Sample




   Data entry screen
   Flags input format errors
   Requires a valid Adult Member Sponsor
   Prompts to renew Adult Sponsor if expired membership
ASP.NET Web Form Sample




   Lists books on loan
   Allows check out of books
   Non-modal confirmation message
   Prompts to renew Membership if expired
ADO.NET Code Sample - Parameters
// Create DB connection with connection string
        using (SqlConnection connection = new SqlConnection(Properties.Settings.Default.LibraryConnectionString))
        {
           // Define the SQL Command
           using (SqlCommand command = new SqlCommand(quot;checkoutquot;))
           {
              // SQL Command is a stored Procedure
              command.CommandType = CommandType.StoredProcedure;
              command.Connection = connection;

                // Load the Parameters
                command.Parameters.AddWithValue(quot;@Member_Noquot;, memberID);
                command.Parameters.AddWithValue(quot;@ISBNquot;, isbn);
                command.Parameters.AddWithValue(quot;@Copy_Noquot;, copyNumber);

                // Open connection
                connection.Open();

                // Execute the Stored Procedure
                command.ExecuteNonQuery();
            }
        }
ADO.NET Code Sample

Use of Ordinal Column values for efficiency:
    // Define Common Ordinal Column IDs
    int titleColumn = reader.GetOrdinal(quot;titlequot;);
    int authorColumn = reader.GetOrdinal(quot;authorquot;);
    int memberNumberColumn = reader.GetOrdinal(quot;member_noquot;);
    int outDateColumn = reader.GetOrdinal(quot;out_datequot;);
    int dueDateColumn = reader.GetOrdinal(quot;due_Datequot;);

    // Create object to read into
    object[] allFields = new object[reader.FieldCount];
    reader.Read();


Use of Typed Dataset Table Adapters:
    // Create Typed Dataset Table adapter to connect to database
    ItemsTableAdapter itemsTableAdapter = new ItemsTableAdapter();

    // The stored proc has one input parameter(@Member_No)
    int returnValue = itemsTableAdapter.Fill(ids.Items, memberID);
Stored Procedure Sample
/* ADDNEWBOOK
                                                       …
Adds abook to the library
error checking ensures that valid parameters           ALTER proc [dbo].[addnewbook]
are supplied for all non nullable fields.                     @ISBN int = NULL,
                                                              @Title varchar(63) = NULL,
                                                              @Author varchar(31) = NULL,
Input Parameters:
                                                              @Translation char(8) = NULL,
      @ISBN smallint = NULL,
                                                              @Cover char(8) = NULL,
      @Title varchar(63) = NULL,                              @Loanable char(1) = NULL,
      @Author varchar(31) = NULL,                             @Copy_No int Output
      @Translation char(8) = NULL,
                                                       as
      @Cover char(8) = NULL,
      @Loanable char(1) = NULL
                                                       begin try
                                                               execute addmessages -- Set up error messages
Output Parameters:
                                                              declare @New_Copy_No int
     @Copy_No int = Output
                                                              declare @New_Title_No int
Error Codes: Error_State 12
                                                              if @ISBN is NULL
      50018 - Invalid ISBN                                    Begin
      50019 - @ISBN must be between 1 and                            print 'Invalid ISBN‘
      2,147,483,647                                                  raiserror (50018,11,12) -- Invalid ISBN
                                                                     return
      50032 - No more Copies can be added to Library
                                                              End
      50111 - SQL Error Inserting New Title
                                                       …
…
Stored Procedure Sample
                                                            ...
…
                                                            end try
                                                                      begin catch -- raise an error to pass up the...
begin try -- Insert a new Copy                                        DECLARE @ErrorMessage NVARCHAR(4000);
        insert copy (ISBN, Copy_No, Title_No, On_Loan)                DECLARE @ErrorSeverity INT;
                                                                      DECLARE @ErrorState INT;
        values( @ISBN, @New_Copy_No,
                                                                      SELECT
                  @New_Title_No, 'N')
                                                                              @ErrorMessage = ERROR_MESSAGE(),
end try
                                                                              @ErrorSeverity = ERROR_SEVERITY(),
begin catch -- If an error occurs during insert                               @ErrorState = ERROR_STATE()
        print 'SQL Error Inserting New Copy‘
                                                                    RAISERROR (@ErrorMessage, -- Message text.
        rollback tran
                                                                           @ErrorSeverity, -- Severity.
        raiserror (50113,16,12) -- Error Inserting New...
                                                                           @ErrorState -- State.
        Return
                                                                           )
end catch                                                   end catch
set @Copy_No = @New_Copy_No
commit tran -- Add Item was successful
return


…

Más contenido relacionado

La actualidad más candente

Building Data Mapper PHP5
Building Data Mapper PHP5Building Data Mapper PHP5
Building Data Mapper PHP5Vance Lucas
 
Introduction To Oracle Sql
Introduction To Oracle SqlIntroduction To Oracle Sql
Introduction To Oracle SqlAhmed Yaseen
 
Transformations - how Oracle rewrites your statements
Transformations - how Oracle rewrites your statementsTransformations - how Oracle rewrites your statements
Transformations - how Oracle rewrites your statementsSage Computing Services
 
Crafting beautiful software
Crafting beautiful softwareCrafting beautiful software
Crafting beautiful softwareJorn Oomen
 
Business Rules with Brick
Business Rules with BrickBusiness Rules with Brick
Business Rules with Brickbrian d foy
 
Obtain better data accuracy using reference tables
Obtain better data accuracy using reference tablesObtain better data accuracy using reference tables
Obtain better data accuracy using reference tablesKiran Venna
 
Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26SynapseindiaComplaints
 
Entity Attribute Value (Eav)
Entity   Attribute   Value (Eav)Entity   Attribute   Value (Eav)
Entity Attribute Value (Eav)Tâm
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsPierre MARTIN
 
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)Mark Wilkinson
 
Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Konstantin Kudryashov
 
Lecture4 php by okello erick
Lecture4 php by okello erickLecture4 php by okello erick
Lecture4 php by okello erickokelloerick
 
Introduction to Clean Code
Introduction to Clean CodeIntroduction to Clean Code
Introduction to Clean CodeJulio Martinez
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в MagentoMagecom Ukraine
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologyDaniel Knell
 

La actualidad más candente (20)

Building Data Mapper PHP5
Building Data Mapper PHP5Building Data Mapper PHP5
Building Data Mapper PHP5
 
Introduction To Oracle Sql
Introduction To Oracle SqlIntroduction To Oracle Sql
Introduction To Oracle Sql
 
Transformations - how Oracle rewrites your statements
Transformations - how Oracle rewrites your statementsTransformations - how Oracle rewrites your statements
Transformations - how Oracle rewrites your statements
 
Crafting beautiful software
Crafting beautiful softwareCrafting beautiful software
Crafting beautiful software
 
Business Rules with Brick
Business Rules with BrickBusiness Rules with Brick
Business Rules with Brick
 
Obtain better data accuracy using reference tables
Obtain better data accuracy using reference tablesObtain better data accuracy using reference tables
Obtain better data accuracy using reference tables
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
 
Oracle SQL Advanced
Oracle SQL AdvancedOracle SQL Advanced
Oracle SQL Advanced
 
Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26
 
Entity Attribute Value (Eav)
Entity   Attribute   Value (Eav)Entity   Attribute   Value (Eav)
Entity Attribute Value (Eav)
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP Applications
 
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
 
Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Intro to Perl and Bioperl
Intro to Perl and BioperlIntro to Perl and Bioperl
Intro to Perl and Bioperl
 
Lecture4 php by okello erick
Lecture4 php by okello erickLecture4 php by okello erick
Lecture4 php by okello erick
 
Introduction to Clean Code
Introduction to Clean CodeIntroduction to Clean Code
Introduction to Clean Code
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 

Destacado

The Mature Worker’S Job Search
The Mature Worker’S Job SearchThe Mature Worker’S Job Search
The Mature Worker’S Job SearchMarion_Wangugi
 
市民農園的期末報告
市民農園的期末報告市民農園的期末報告
市民農園的期末報告YuLung Hsu
 
Driving value in your business 01152014 b
Driving value in your business 01152014 bDriving value in your business 01152014 b
Driving value in your business 01152014 bDavid Belgum
 
FRCC Quick Facts
FRCC Quick FactsFRCC Quick Facts
FRCC Quick Factsfrcc
 
Kids on the Move project
Kids on the Move projectKids on the Move project
Kids on the Move projectguest16d363
 
Children's Rights and Private Corporations
Children's Rights and Private CorporationsChildren's Rights and Private Corporations
Children's Rights and Private Corporationsnpetten
 

Destacado (7)

Mature job seekers workshop
Mature job seekers workshopMature job seekers workshop
Mature job seekers workshop
 
The Mature Worker’S Job Search
The Mature Worker’S Job SearchThe Mature Worker’S Job Search
The Mature Worker’S Job Search
 
市民農園的期末報告
市民農園的期末報告市民農園的期末報告
市民農園的期末報告
 
Driving value in your business 01152014 b
Driving value in your business 01152014 bDriving value in your business 01152014 b
Driving value in your business 01152014 b
 
FRCC Quick Facts
FRCC Quick FactsFRCC Quick Facts
FRCC Quick Facts
 
Kids on the Move project
Kids on the Move projectKids on the Move project
Kids on the Move project
 
Children's Rights and Private Corporations
Children's Rights and Private CorporationsChildren's Rights and Private Corporations
Children's Rights and Private Corporations
 

Similar a Frank Rodenbaugh Portfolio

Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CDavid Wheeler
 
Java best practices
Java best practicesJava best practices
Java best practicesRay Toal
 
Synchronize applications with akeneo/batch
Synchronize applications with akeneo/batchSynchronize applications with akeneo/batch
Synchronize applications with akeneo/batchgplanchat
 
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdfSummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdfARORACOCKERY2111
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypesVarun C M
 
Michael Colon Portfolio
Michael Colon PortfolioMichael Colon Portfolio
Michael Colon Portfoliomichael_colon
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best PracticesJitendra Zaa
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl TechniquesDave Cross
 
Bdd for-dso-1227123516572504-8
Bdd for-dso-1227123516572504-8Bdd for-dso-1227123516572504-8
Bdd for-dso-1227123516572504-8Frédéric Delorme
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosDivante
 
Function Procedure Trigger Partition.pdf
Function Procedure Trigger Partition.pdfFunction Procedure Trigger Partition.pdf
Function Procedure Trigger Partition.pdfSanam Maharjan
 
Christopher Latham Portfolio
Christopher Latham PortfolioChristopher Latham Portfolio
Christopher Latham Portfoliolathamcl
 
BP208 Fabulous Feats with @Formula
BP208 Fabulous Feats with @FormulaBP208 Fabulous Feats with @Formula
BP208 Fabulous Feats with @FormulaKathy Brown
 
Tom Lazar Using Zope3 Views And Viewlets For Plone 3.0 Product Development
Tom Lazar   Using Zope3 Views And Viewlets For Plone 3.0 Product DevelopmentTom Lazar   Using Zope3 Views And Viewlets For Plone 3.0 Product Development
Tom Lazar Using Zope3 Views And Viewlets For Plone 3.0 Product DevelopmentVincenzo Barone
 
Fine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELFine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELThomas Zimmermann
 
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
javascript-variablesanddatatypes-130218094831-phpapp01.pdfjavascript-variablesanddatatypes-130218094831-phpapp01.pdf
javascript-variablesanddatatypes-130218094831-phpapp01.pdfAlexShon3
 

Similar a Frank Rodenbaugh Portfolio (20)

Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning C
 
Java best practices
Java best practicesJava best practices
Java best practices
 
Synchronize applications with akeneo/batch
Synchronize applications with akeneo/batchSynchronize applications with akeneo/batch
Synchronize applications with akeneo/batch
 
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdfSummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
Michael Colon Portfolio
Michael Colon PortfolioMichael Colon Portfolio
Michael Colon Portfolio
 
Apex Testing and Best Practices
Apex Testing and Best PracticesApex Testing and Best Practices
Apex Testing and Best Practices
 
TDD, BDD and mocks
TDD, BDD and mocksTDD, BDD and mocks
TDD, BDD and mocks
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
Bdd for-dso-1227123516572504-8
Bdd for-dso-1227123516572504-8Bdd for-dso-1227123516572504-8
Bdd for-dso-1227123516572504-8
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenarios
 
Function Procedure Trigger Partition.pdf
Function Procedure Trigger Partition.pdfFunction Procedure Trigger Partition.pdf
Function Procedure Trigger Partition.pdf
 
Little Big Ruby
Little Big RubyLittle Big Ruby
Little Big Ruby
 
Christopher Latham Portfolio
Christopher Latham PortfolioChristopher Latham Portfolio
Christopher Latham Portfolio
 
Lecture14
Lecture14Lecture14
Lecture14
 
BP208 Fabulous Feats with @Formula
BP208 Fabulous Feats with @FormulaBP208 Fabulous Feats with @Formula
BP208 Fabulous Feats with @Formula
 
Tom Lazar Using Zope3 Views And Viewlets For Plone 3.0 Product Development
Tom Lazar   Using Zope3 Views And Viewlets For Plone 3.0 Product DevelopmentTom Lazar   Using Zope3 Views And Viewlets For Plone 3.0 Product Development
Tom Lazar Using Zope3 Views And Viewlets For Plone 3.0 Product Development
 
Fine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELFine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFEL
 
DataMapper
DataMapperDataMapper
DataMapper
 
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
javascript-variablesanddatatypes-130218094831-phpapp01.pdfjavascript-variablesanddatatypes-130218094831-phpapp01.pdf
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
 

Frank Rodenbaugh Portfolio

  • 2. Table of Contents • Library System Overview • Design Highlights • Windows Form Sample • ASP.NET Web Form Sample • ADO.NET Code Sample • Stored Procedure Sample
  • 3. Library System Overview • Introduction: – I designed and implemented a library system to handle day-to-day operations performed by librarians. • Audience: – Librarians will be the primary users of the applications. • Project Goals: – Design and develop Windows and Web based applications that allow librarians to add adult and juvenile members, check in and check out books, and maintain an inventory of the library’s books. – Develop code that is easily maintainable. – Provide validation for all required fields. – Provide error handling – Produce a user interface that is intuitive, requiring minimal training for users while minimizing resource utilization
  • 4. Design Highlights • 3 Tiered Architecture • User-friendly interface developed using MDI forms with menu strip navigation and ASP.NET Web forms using Tree View navigation • Business ruled and validations encapsulated within the Business Tier • ADO.NET Data Access called Stored Procedures in the SQL Server Database • Data transported between the layers using Entities and Strongly-Typed Data Sets
  • 5. Windows Form Sample  Data entry screen  Flags input format errors  Requires a valid Adult Member Sponsor
  • 6. Windows Form Sample  Lists books on loan in a Data Grid View  Allows check out of books  Non-modal confirmation message
  • 7. ASP.NET Web Form Sample  Data entry screen  Flags input format errors  Requires a valid Adult Member Sponsor  Prompts to renew Adult Sponsor if expired membership
  • 8. ASP.NET Web Form Sample  Lists books on loan  Allows check out of books  Non-modal confirmation message  Prompts to renew Membership if expired
  • 9. ADO.NET Code Sample - Parameters // Create DB connection with connection string using (SqlConnection connection = new SqlConnection(Properties.Settings.Default.LibraryConnectionString)) { // Define the SQL Command using (SqlCommand command = new SqlCommand(quot;checkoutquot;)) { // SQL Command is a stored Procedure command.CommandType = CommandType.StoredProcedure; command.Connection = connection; // Load the Parameters command.Parameters.AddWithValue(quot;@Member_Noquot;, memberID); command.Parameters.AddWithValue(quot;@ISBNquot;, isbn); command.Parameters.AddWithValue(quot;@Copy_Noquot;, copyNumber); // Open connection connection.Open(); // Execute the Stored Procedure command.ExecuteNonQuery(); } }
  • 10. ADO.NET Code Sample Use of Ordinal Column values for efficiency: // Define Common Ordinal Column IDs int titleColumn = reader.GetOrdinal(quot;titlequot;); int authorColumn = reader.GetOrdinal(quot;authorquot;); int memberNumberColumn = reader.GetOrdinal(quot;member_noquot;); int outDateColumn = reader.GetOrdinal(quot;out_datequot;); int dueDateColumn = reader.GetOrdinal(quot;due_Datequot;); // Create object to read into object[] allFields = new object[reader.FieldCount]; reader.Read(); Use of Typed Dataset Table Adapters: // Create Typed Dataset Table adapter to connect to database ItemsTableAdapter itemsTableAdapter = new ItemsTableAdapter(); // The stored proc has one input parameter(@Member_No) int returnValue = itemsTableAdapter.Fill(ids.Items, memberID);
  • 11. Stored Procedure Sample /* ADDNEWBOOK … Adds abook to the library error checking ensures that valid parameters ALTER proc [dbo].[addnewbook] are supplied for all non nullable fields. @ISBN int = NULL, @Title varchar(63) = NULL, @Author varchar(31) = NULL, Input Parameters: @Translation char(8) = NULL, @ISBN smallint = NULL, @Cover char(8) = NULL, @Title varchar(63) = NULL, @Loanable char(1) = NULL, @Author varchar(31) = NULL, @Copy_No int Output @Translation char(8) = NULL, as @Cover char(8) = NULL, @Loanable char(1) = NULL begin try execute addmessages -- Set up error messages Output Parameters: declare @New_Copy_No int @Copy_No int = Output declare @New_Title_No int Error Codes: Error_State 12 if @ISBN is NULL 50018 - Invalid ISBN Begin 50019 - @ISBN must be between 1 and print 'Invalid ISBN‘ 2,147,483,647 raiserror (50018,11,12) -- Invalid ISBN return 50032 - No more Copies can be added to Library End 50111 - SQL Error Inserting New Title … …
  • 12. Stored Procedure Sample ... … end try begin catch -- raise an error to pass up the... begin try -- Insert a new Copy DECLARE @ErrorMessage NVARCHAR(4000); insert copy (ISBN, Copy_No, Title_No, On_Loan) DECLARE @ErrorSeverity INT; DECLARE @ErrorState INT; values( @ISBN, @New_Copy_No, SELECT @New_Title_No, 'N') @ErrorMessage = ERROR_MESSAGE(), end try @ErrorSeverity = ERROR_SEVERITY(), begin catch -- If an error occurs during insert @ErrorState = ERROR_STATE() print 'SQL Error Inserting New Copy‘ RAISERROR (@ErrorMessage, -- Message text. rollback tran @ErrorSeverity, -- Severity. raiserror (50113,16,12) -- Error Inserting New... @ErrorState -- State. Return ) end catch end catch set @Copy_No = @New_Copy_No commit tran -- Add Item was successful return …