Forum Replies Created

Viewing 15 posts - 21,496 through 21,510 (of 26,484 total)

  • RE: Select query runs forever in sql 2005

    I came up with another option, and I think it is easier. It uses patindex to find the first non-zero character.

    select substring(@varstr,patindex('%[^0]%', @varstr),len(@varstr) - patindex('%[^0]%', @varstr) + 1)

  • RE: T-SQL Operators

    I guess not enough people complained about the answer to this question.

  • RE: Performance issue with tally solution

    I have to agree with Jeff. This was an awesome thread and it demonstrates what a community can do when it works together for a common purpose. Hats...

  • RE: Select query runs forever in sql 2005

    See if you can use this code to strip leading zeros and if it helps your query.

    declare @varstr nvarchar(50);

    set @varstr = '000045691823';

    select substring(@varstr,patindex('%[A-Za-z1-9]%', @varstr),len(@varstr) - patindex('%[A-Za-z1-9]%', @varstr) + 1)

    set @varstr...

  • RE: Update query problem

    You should still be able to use the code sample above to develop a solution to your problem at work.

  • RE: Are the posted questions getting worse?

    Bruce W Cassidy (4/14/2009)


    [font="Verdana"]Didn't RBarryYoung's article start a little bun fight! It will be fun to watch. Brave, brave man.[/font]

    Looks like another "cursor man" out there if you...

  • RE: Update query problem

    May I suggest you read this article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

    Also you may want to read this blog: The Flip...

  • RE: Update query problem

    Does this help?

    create table dbo.xtable (

    ID int,

    val1 varchar(30) null,

    val2 varchar(30) null

    );

    create table #tmp (

    ID...

  • RE: Update query problem

    gbechar (4/14/2009)


    unfortunately I am writing from home and have no Internet at work.

    Yes , I need to update exsiting data

    Well, you need to provide a clearer picture of what you...

  • RE: Are the posted questions getting worse?

    GilaMonster (4/14/2009)


    Bruce W Cassidy (4/14/2009)


    [font="Verdana"]I took a lesson from St Lynn. Not sure it will help, but worth a shot.[/font]

    I'm not even sure what the question is any longer.

    Not...

  • RE: Update query problem

    Still confused. One, the formatting doesn't allow me to easily see what is in what column. Also, Are we updating existing data? Your original post really did...

  • RE: Are the posted questions getting worse?

    Three years experience, asking questions like this? More like 1 month of experience over 36 months.

  • RE: There Must Be 15 Ways To Lose Your Cursors... part 1, Introduction

    RBarryYoung (4/14/2009)


    Manie Verster (4/14/2009)


    ...

    RJ, I hope you don't mind but I'm going to jump in here. Barry, maybe RJ's requirements is small enough to justify a distribution list but every...

  • RE: Are the posted questions getting worse?

    GilaMonster (4/14/2009)


    Lynn Pettis (4/14/2009)


    Gail, see the latest on this one you were just on?

    I saw it. I had a half-written, very snarky reply that I deided was better not posted....

  • RE: Update query problem

    Okay, try this instead:

    create table dbo.xtable (

    ID int,

    val1 varchar(30) null,

    val2 varchar(30) null

    );

    create table #tmp (

    ...

Viewing 15 posts - 21,496 through 21,510 (of 26,484 total)