AdventureWorks script screwed up my Master database

  • I downloaded the script Adventure Works 2008 R2 OLTP script from CodePlex to create the AW database. Well, it was not able to create the database but from some reason it did manage to put a whole bunch of Adventureworks tables, views and who knows what else in my Master database! Can somebody please guide me as to why this may have happened and what I can do? Since this is a new DEV environment, I do not have a backup of master yet.

    Here is the result of running the downloaded script, "Query completed with errors"

    Msg 156, Level 15, State 1, Line 30

    Incorrect syntax near the keyword 'on'.

    Msg 911, Level 16, State 1, Line 2

    Database 'AdventureWorks2008R2' does not exist. Make sure that the name is entered correctly.

    Msg 102, Level 15, State 1, Procedure iPurchaseOrderDetail, Line 42

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure iPurchaseOrderDetail, Line 54

    Incorrect syntax near 'CATCH'.

    Msg 102, Level 15, State 1, Procedure uPurchaseOrderDetail, Line 54

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure uPurchaseOrderDetail, Line 66

    Incorrect syntax near 'CATCH'.

    Msg 102, Level 15, State 1, Procedure uPurchaseOrderHeader, Line 23

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure uPurchaseOrderHeader, Line 35

    Incorrect syntax near 'CATCH'.

    Msg 102, Level 15, State 1, Procedure iduSalesOrderDetail, Line 71

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure iduSalesOrderDetail, Line 83

    Incorrect syntax near 'CATCH'.

    Msg 102, Level 15, State 1, Procedure uSalesOrderHeader, Line 56

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure uSalesOrderHeader, Line 68

    Incorrect syntax near 'CATCH'.

    Msg 102, Level 15, State 1, Procedure dVendor, Line 30

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure dVendor, Line 42

    Incorrect syntax near 'CATCH'.

    Msg 102, Level 15, State 1, Procedure iWorkOrder, Line 29

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure iWorkOrder, Line 41

    Incorrect syntax near 'CATCH'.

    Msg 102, Level 15, State 1, Procedure uWorkOrder, Line 30

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure uWorkOrder, Line 42

    Incorrect syntax near 'CATCH'.

    Msg 102, Level 15, State 1, Procedure ufnGetDocumentStatusText, Line 11

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure ufnGetPurchaseOrderStatusText, Line 11

    Incorrect syntax near ';'.

    Msg 102, Level 15, State 1, Procedure ufnGetSalesOrderStatusText, Line 11

    Incorrect syntax near ';'.

  • You likely were connected to master when you ran the script. The adventureworks database failed to create, and I'm guessing the script has a "USE adventureworks" statement that would have switched your database context to adventure works and create the objects there. Since the database creation failed, it was unable to switch to the adventureworks database and went on creating the objects in master. You will just have to manually drop the objects it created.

  • Another option would be to rebuild your system databases to get you back to your vanilla installation (presuming this is not a prod server with other amendments)

    https://msdn.microsoft.com/en-us/library/dd207003(v=sql.105).aspx

    the extra objects in master will not cause any issues, and in any event should be easily identifiable as they will not be listed as system objects.

    ---------------------------------------------------------------------

  • use master

    go

    select type_desc, name

    from sys.objects

    where is_ms_shipped =0

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply