• If you do a SELECT * FROM information_schema.tables you'll see that there's a column there called TABLE_SCHEMA. That's where you'll find your dbo. I'm assuming you are wanting to handle other schemas that aren't dbo.

    Just modify the script so that you can pass TABLE_SCHEMA + TABLE_NAME.