Forum Replies Created

Viewing 15 posts - 391 through 405 (of 413 total)

  • RE: Stripping Out Quotes

    It's my impession too that an rtrim is performed when comparing strings. That's why strange things may happen:

    declare

    @a varchar(1),

    @b-2 varchar(1),

    @C varchar(1)

    select @a...

  • RE: Stripping Out Quotes

    Sorry - it's because my db is on 65 compatibility level (enterprise manager, right-click on db, properties, options tab).

  • RE: Stripping Out Quotes

    Try this:

    if '' = ' '

     select 'equal'

    else

     select 'not equal'

    -- returns 'equal'

    select replace('a"a', '"', '')

    -- returns 'a a'

    String manipulations in T-SQL are tricky (not to say strange) - at least on...

  • RE: Stripping Out Quotes

    Sorry - that was a reply to the previous post

  • RE: Stripping Out Quotes

     That replaces " by a single space, unfortunately. Is there an easy way to have all quotes in a string replaced by what is known as "the empty string" in a traditional...

  • RE: How to skip the records

    Well, you actually gave me the idea yourself, in the thread Please give me a replacement for a Cursor,...

  • RE: Getting Nth Maximum

    The original problem didn't say what to do if there is no N'th highest salary. My solution doesn't output a deptno in this case, so I guess that's OK

  • RE: Getting Nth Maximum

    Maybe this one is easier to read (I haven't tested performance):

    create table tmb1 (deptno numeric, sal numeric)

    insert into tmb1 (deptno, sal ) values (1, 1000)

    insert into tmb1 (deptno, sal )...

  • RE: How to skip the records

    I think I have an even faster solution than you, Remi:

    Declare @Sample as int

    Declare @OffSet as int

    SET @Sample = 3

    SET @OffSet = 1

    create table #a(id int identity(1,1), name varchar(100))

    insert into...

  • RE: Help with String manipulation

    Try something like

    select substring(staffname, 1, charindex(' ', staffname))

    This requires exactly one firstname and one surname - as in your sample data. If this is not enough, please describe what the...

  • RE: Insert into problem with linked server

    Same problem with dynamic execution - and there is no firewall between the servers, I've been told (I have tested that port 135 is open).

     

  • RE: Why is my dynamic "insert select" soooooo slow?

    Two simoultaneous db connections should have different @@SPIDs, I don't think there is a problem here. On the other hand, there may have been an earlier (now terminated) db connection...

  • RE: Why is my dynamic "insert select" soooooo slow?

    I think so - I use this trick with @@SPID once in a while. One problem with temp tables is that you can't index them. In your case, put a...

  • RE: Why is my dynamic "insert select" soooooo slow?

    Just to get a hint of where the processing time is spent:

    What happens to processing time if you use a permanent table results (same definition), instead of a temp table?

    What...

  • RE: Insert into problem with linked server

    Scott, Thanks for an excellent suggestion. Unfortunately both servers are Win 2000. But I have a feeling that we are getting closer...

    Sushila, Openquery works... Unfortunately I cannot use it, since...

Viewing 15 posts - 391 through 405 (of 413 total)