SSMS 2012 - loaded saved query not executable ("invalid object name" error)
You might need to add "GO" after your "USE [DB_NAME]" statement.
Some commands need to be first in the batch.
With GO, the USE DB command is executed as first batch, with another batch following it.

So:

USE [DB_NAME]
GO

CREATE PROCEDURE...