Re: creating unique index and clustered index in sql server management studio

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Yes I agree that it is misleading and not a very good design that it leaves
out a bunch of objects. Its really only useful for a quick look at the DDL
of the table itself. Anything more should be done thru the Generate Scripts
task.

--
Andrew J. Kelly SQL MVP


"gary" <garyseven7@xxxxxxxxxxxxx> wrote in message
news:OaEMUSaDGHA.4052@xxxxxxxxxxxxxxxxxxxxxxx
> Thanks for all your help.
>
> It is kind of odd that the script table does not generate the indexes and
> the script database that is in the wizard is capable of generating the
> sciprts for the index (it doesn't generate them by default, you have to
> select the script indexes to be true).
>
> SQL 2000 GUI created the indexes by creating a constraint while the new
> SQL 2005 GUI creates them using the create index statement. If created
> as a constraint the alter statement ins generated in the create table, if
> created in a create index statement it is not.
>
> This seems somewhat consistantly inconsistant so to speak.
>
> Thanks for helping clarify the issue.
>
>
> "Andrew J. Kelly" <sqlmvpnooospam@xxxxxxxxxxxx> wrote in message
> news:e4Bl$HYDGHA.2704@xxxxxxxxxxxxxxxxxxxxxxx
>> See in-line:
>>
>> --
>> Andrew J. Kelly SQL MVP
>>
>>
>> "gary" <garyseven7@xxxxxxxxxxxxx> wrote in message
>> news:%23NRW54XDGHA.3444@xxxxxxxxxxxxxxxxxxxxxxx
>>> Hello,
>>>
>>> I have run across a very strange situation.
>>>
>>> If i use the management studio to change an index that is clustered is
>>> does not actually change the index. It shows up in the gui as changed,
>>> but the data is not changed when returning the data.
>>
>>
>> The order in which data is returned is never guarenteed unless you use an
>> ORDER BY clause. This has always been the case and is nothing new.
>> Without an ORDER BY clause SQL Server is free to return the rows in what
>> ever order it seems most appropriate. Often times when you have a
>> clustered index on a table and issue a SELECT without a WHERE clause it
>> will return the data in mostly clustered index order. But this has never
>> been guarenteed and should not rely on that behaviour.
>>
>>
>>
>>> Also when you use the createto> when right clicking on the table, none
>>> of the indexes or index constraints are recreated.
>>>
>>> In order to make the changes work you have to manually create the
>>> constraints:
>>
>> If you want all the Indexes, constraints etc. you should use the Generate
>> Scripts wizard found by right clicking on the DB under Tasks. There you
>> can pick and choose all objects or none.
>>
>>
>>> ie
>>> ALTER TABLE dbo._messages_initiated_from ADD CONSTRAINT
>>>
>>> IX_key_messages_initiated_from UNIQUE CLUSTERED
>>>
>>> (
>>>
>>> key_messages_initiated_from
>>>
>>> ) ON [PRIMARY]
>>>
>>> CREATE NONCLUSTERED INDEX IX_initiated_from ON
>>> dbo._messages_initiated_from
>>>
>>> (
>>>
>>> initiated_from
>>>
>>> ) ON [PRIMARY]
>>>
>>> Then the changes work and the code is genereted in the scripts.
>>>
>>> This used to work in enterprise manager in sql 2000.
>>>
>>> Any ideas why this is not functioning right?
>>>
>>>
>>>
>>> Thanks
>>>
>>> gary
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Question on Structuring Product Attributes
    ... materialized-views that bring the data together, ... and constraint indexes) used to enforce the constraints ... that is computed using the DECODE function (not supported by SQL ... VEHICLES, SEDANS, and SUVS are going to be much larger than 2 - 3 ...
    (comp.databases.theory)
  • Re: SQL
    ... Even SQL cannot avoid them. ... If you add X with one constraint to Y with other constraint and what would ... RDBMS exist only because in 70s there were no languages capable to provide ... There is no numeric type for all purposes. ...
    (comp.object)
  • Re: SQL
    ... SQL is more or less based on "COBOL thinking". ... possible nor most type-free that a relational query language can be. ... If you add X with one constraint to Y with other constraint and what would ... A relational interface fits to a kd-tree as a beach umbrella does ...
    (comp.object)
  • Re: Help Understanding mx.ODBC Error
    ... running the scripts on old data (that these scripts were able to digest ... Greg Corradini wrote: ... But recently they continue to bail on the mycursor.execute('An SQL ... Sent from the Python - python-list mailing list archive at Nabble.com. ...
    (comp.lang.python)
  • Re: Help Understanding mx.ODBC Error
    ... Greg Corradini wrote: ... I wrote two scripts using mx.ODBC on an Access DB. ... But recently they continue to bail on the mycursor.execute('An SQL ... I used the proper parameterization with "?" ...
    (comp.lang.python)