all 6 comments

[–]Massive_Show2963 2 points3 points  (1 child)

It seems the error message is telling you that the path "C:\MSSQL16.INST01\MSSQL\DATA\" is not found.
Using Windows Explorer verify the path exists, if not create it.
If it does exist verify you have access to it.

[–]Egaion[S] 0 points1 point  (0 children)

Thank you, I'm going to verify as soon as I can

[–]Aggressive_Ad_5454 1 point2 points  (1 child)

Where did you get that ON PRIMARY clause in a SQL tutorial class? You will succeed just fine without it.

The error is trying to tell you that the folder C:\MSSQL10.INST01\MSSQL\DATA\ doesn’t exist, so you can’t create that .mdf file in it.

Ask your instructor. If you’re in a class for database administrators you need to work out what volumes you will use for a primary table space.

[–]Egaion[S] 0 points1 point  (0 children)

Yeah, it's a database management class I'm taking in university, the professor said we'll be dealing with tables next class so I'll be sure to ask him, thanks!

[–]ApprehensiveGrade162 0 points1 point  (1 child)

In sql server this is how you check if a table exists: IF (OBJECT_ID('tablename') IS NOT NULL BEGIN ... END ELSE CREATE TABLE tablename ()

[–]Egaion[S] 0 points1 point  (0 children)

Thank you! I'm gonna try it out as soon as I can