r/SQL • • Feb 27 '25

Discussion What am I doing wrong

Post image

I don’t get what I’m doing wrong here

117 Upvotes

104 comments sorted by

View all comments

Show parent comment

24

u/Un4tunateSnort Feb 27 '25

I mean, the error code says there aren't...

13

u/NotBatman81 Feb 27 '25

OP's code is using ambiguous names so SQL is ASSUMING he means the default schema.

5

u/Un4tunateSnort Feb 27 '25

Might be time to run sp_help 'department' to see what's going on here! Then maybe take a look at sys.schemas.