CREATE UNIQUE INDEX terminated

  • This statement will never work. You're mixing DDL and DML in one. Either create the table explicitely BEFORE the INSERT with CREATE TABLE or use SELECT INTO.

    You got me really confused. What are you really after? What are you trying to accomplish?

    Also, I suspect you mean Vyas Kondreddi. Which article do you mean? And maybe will this http://www.karaszi.com/sqlserver/info_generate_script.asp help?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • ok, this is done. I succeded into it by step by step. thanks a lot for your help. I now understand much more about this structure.

    Now i have to get the queries to work from Vb-script.

    I have tried to transfer a query from query-analyseer to vb-script, but it doesn't wish to coorporate with me. But it's not this topic, needs to be placed in another forum. 

  •  I tried your way and got this everytime I create the index

     

     

    Unable to create index 'PK_Weather'. 

    ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 1. Most significant primary key is '12'.

    [Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint. See previous errors.

    [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.

  • right, this way wasn't good enough, but suddenly i could step by step confirm a new id on the old table, by setting properties right.

    Why, i don't know, thought i had tried before, but suddenly it was there. SO- no problems at this point more.

    BUt if i try to make a select * from all tables (by name) i only can use 11 tables, 3 specific tables does not funktion even if they are in a select with one of the "bad" tables and one of the good. Why, i don't know.

     

  • sorry, i don't have been here for some time, have been busy. But have found the solution. i make the joins into entreprise manager and put them into the script. It works now.

  • Hi ALZDBA!

    Your query helped me a lot!! Thank you very much!

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply