• could it be this simple?

    i didn't see enough details to directly emoulate the error, so as i was trying something to recreate teh issue, i got this;

    similar to the behavior of ALTER TABLE ADD COLUMN X, where you cannot use the new column until a GO command has occurred, I think CREATE SCHEMA [schemaName] requires a GO command before you can do your INSERT INTO.

    'CREATE SCHEMA' must be the first statement in a query batch.

    here's a simple code example that shows it:

    CREATE TABLE dbo.[results] (

    [RESULTSID] INT IDENTITY(1,1) NOT NULL,

    [RESULTText] VARCHAR(1024) NULL)

    insert into results

    select 'stuff' union all select 'more stuff'

    create schema 'bob'

    select *

    into bob.results

    from dbo.[results]

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!