Forum Replies Created

Viewing 15 posts - 14,056 through 14,070 (of 14,953 total)

  • RE: How to prevent insert/update trigger sequence?

    I just tried this:

    CREATE TABLE [dbo].[tblA](

    [pk] [int] IDENTITY(1,1) PRIMARY KEY,

    [col1] [varbinary](8) NULL,

    [col2] AS (CONVERT([varchar](18),[col1],0)),

    [col3] AS ([sys].[fn_varbintohexstr]([col1])),

    [col4] AS (CONVERT([varchar](max),[sys].[fn_varbintohexstr]([col1]),0)),

    [col5] AS (CONVERT([varchar](18),[sys].[fn_varbintohexstr]([col1]),0)),

    [col6] AS (upper(CONVERT([varchar](18),[sys].[fn_varbintohexstr]([col1]),0))))

    Then:

    insert into dbo.tbla (col1)

    select...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: varchar(8) query

    select (column list)

    from dbo.Table

    where len(column) > 8

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: compatibility level 80 and 90

    The problem is the colum in the Order By. Needs the table alias on it.

    The difference is that 80 (SQL 2000) can't order by a column alias, while 90...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: CTE's are useless

    My point is that, done correctly[/b], high performance code will always have the correct integrity.

    (Emphasis added.)

    Totally agree with you, so long as that statement is included. But that...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: CTE's are useless

    Jeff Moden (4/22/2008)


    GSquared (4/22/2008)


    I would definitely avoid that "speed at all cost" methodology.

    Heh... then why have you posted so much on this thread about speed? 😉 The real answer...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: How to prevent insert/update trigger sequence?

    Leo Nosovsky (4/22/2008)


    Ah, persisted computed column -- I've never used it! That may be just what I need. Do you know if there is a performance impact while running queries...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: ISNULL vs. COALESCE - which to use?

    Grant Fritchey (4/23/2008)


    Until you're down to squeezing the last 10-20ms out of a query, I don't think it matters. COALESCE has a lot more flexibility than ISNULL, so, I'd say,...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: ISNULL vs. COALESCE - which to use?

    I just ran a simple test:

    create table #NullTest (

    ID int identity primary key,

    Date datetime)

    insert into #nulltest (date)

    select

    case

    when number%10 > 0 then dateadd(day, number, '1/1/2000')

    else null

    end

    from common.dbo.bignumbers

    set statistics io...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Any horse racing database users on here?

    First, I recommending looking into getting SQL Server Integrations Services (SSIS) to import the files into a flat table. Same columns as the files you're importing.

    If you're dealing with...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Some Qrys for DTS

    If you actually mean DTS, I'm not sure what to do. If you mean SSIS (which I'm assuming because of the forum you posted this in), then take a...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: inserting into a table with an identity column

    I haven't tried this, but would it be possible to drop the identity column from the temp table before you do the insert into the primary table?

    Theoretically, that might work....

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Identity in descending order

    When you query the data, add "Order By display_id desc". The "desc" at the end makes it go from highest to lowest.

    That should do what you need.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Want to use the correct number format....

    It's a display option. Access "double" = SQL "float". Same storage, same format.

    If you're viewing the number on a form, set the display options for the field to...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: How to prevent insert/update trigger sequence?

    Instead of an after/instead of insert trigger, would it be possible to add a default value to the column?

    For example:

    alter table MyTable

    add constraint DF_Date default (getdate()) for DateColumn

    That would make...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Ambiguous Column name ??

    Piper Skip (4/22/2008)


    Neither suggestion works. The interesting (frustrating) thing about this is the fact that it fails only when included within a stored procedure. Running the two statements...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 15 posts - 14,056 through 14,070 (of 14,953 total)