• 0

SQL Script Help


Question

Hey guys so i have another assignment I am having trouble with. We just setup SQL Server and are creating a script, it asks to run parse first to ensure no errors, then execute. I have attached the pdf of the script i had to copy into sql along with my script in txt format.

i run parse and it opens a new window, but seems to just stop until i hit continue, it then says it completed successfully. when i try to execute the script it get this error, "Msg 2714, Level 16, State 6, Line 5
There is already an object named 'DEPARTMENT' in the database." I am hoping I am just over looking the error. Thanks

 

sql.zip

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Well quite simply, you already have an object in your database named 'Department', if you're all sharing a database that'll be why.

 

Effectively if want to do a check to see i the database object already exists, if not then create it (or drop and recreate it if that's what you want).

Link to comment
Share on other sites

This topic is now closed to further replies.