How do I copy a view from one server to another? I want to copy a view from server S1 --> Database D1 to Server S2 --> Database D2.

I generated the script by right clicking the database(D1)--> tasks--> generate script.  However, when I execute this script in Database D2 it says that D1 doesn't exist.  The error is on line1. 

USE [D1]  -- Line 1
GO
Change the script so that you use the correct database before running it or remove the use statement completely either manually or by not scripting it out to begin with.