incorrect syntax error CREATE VIEW must be the only statement in the batch
<p>OK so here's my code trying to create a view but it keeps on telling me create view must only be the only statement in the batch tried everything need help</p>

<pre><code>CREATE VIEW  [Vendors List] 
AS
    SELECT 
        VendorID, 
        SUM(InvoiceTotal) AS [YTD Invoice Total], 
        SUM(PaymentTotal) AS [YTD Payment Total], 
        SUM(CreditTotal) AS [YTD Credit Total]
    FROM 
        dbo.Invoices
    GROUP BY 
        VendorID
</code></pre>