Home Forums SQL Server 7,2000 SQL Server Newbies How to use unique identifier column where clause of SQL Server 2000? RE: How to use unique identifier column where clause of SQL Server 2000?

  • Your problem is not clear as "no luck" is not very meaningful. Do you mean that no rows are found ? If so, check the value of the uniqueidentifier that is being used.

    use tempdb

    go

    create table FOO

    (FooIduniqueidentifiernot null default newid()

    ,FooDescrvarchar(255)not null

    , constraint FOO_P primary key (FooId)

    )

    insert into FOO (FooDescr)

    select 'First' union select 'Second'

    select * from FOO

    -- replace the value of FooId based on the select

    select * from Foo where FooId = '9E3DF8B0-120B-47B4-B150-375B23EE9DDE'

    SQL = Scarcely Qualifies as a Language