Forum Replies Created

Viewing 15 posts - 1,321 through 1,335 (of 2,894 total)

  • RE: how to remove zero from my string

    ...

    As a matter of fact, both solutions have to be corrected to avoid problems. One is creating a virtual tally table with tally table using a recursive CTE instead of...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: ##table question?

    Just make sure that your sp1 is called by one caller/user at the same time...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how to remove zero from my string

    Steven Willis (8/24/2012)


    Try this:

    CREATE FUNCTION dbo.svfRemoveLeftMostCharacters

    (

    @Source VARCHAR(1000)

    ,@Char CHAR(1)

    )

    RETURNS VARCHAR(1000)

    AS

    BEGIN

    /* This function requires a Tally or Numbers table */

    /* http://www.sqlservercentral.com/articles/T-SQL/62867/ */

    DECLARE

    @NewValue VARCHAR(1000)

    ,@Pos...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Tsql procedure to mutiple rows if it has duplicate id

    SQL Kiwi (8/24/2012)


    Luis Cazares (8/24/2012)


    ...the outer apply with EXP(SUM(LOG(value))) gave some unexpected results...

    Try it with zero or negative numbers in the 'val' column...

    Don't even want to. I've clearly said that...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Tsql procedure to mutiple rows if it has duplicate id

    Luis,

    If you prefer to use "quirky" update for calculating running-total, you better to follow all recommendations as per mentioned article eg. clustered index, maxdop and not duble -assignment (@var...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Tsql procedure to mutiple rows if it has duplicate id

    that will produce requested output based on what you explained so far:

    declare @t table (id int, val int)

    insert @t select 1, 2

    insert @t select 1, 3

    insert @t select 1,...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Tsql procedure to mutiple rows if it has duplicate id

    First what you need to do is to follow this:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: T-SQL String Manipulation- Need help

    Again here, if you don't care much for performance and your input strings are always of the same shown pattern you can do:

    DECLARE @s-2 VARCHAR(8000)

    SET @s-2 = 'A1(1).B22(23).C33(456)'

    SELECT

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: T-SQL String manipulation - 2(Reading numeric values from String appended by '.')

    If you don't care much for performance and your input strings are always of the same shown pattern you can do:

    DECLARE @s-2 VARCHAR(8000)

    SET @s-2 = 'A1(1).B22(23).C33(456)'

    SELECT REPLACE(

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: T-SQL String manipulation - 2(Reading numeric values from String appended by '.')

    I would do all this manipulations implementing CLR functions using Regex (static and compiled - as in an example I gave for your previous post).

    The example solution provided (with WHILE...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: T-SQL String Manipulation- Need help

    You may consider using CLR function:

    using System;

    using System.Data;

    using System.Data.SqlClient;

    using System.Data.SqlTypes;

    using Microsoft.SqlServer.Server;

    using System.Text.RegularExpressions;

    namespace CLRPlay

    {

    public partial class UserDefinedFunctions

    {

    static readonly Regex _regex = new Regex(@"[(][0-9]*[)]",...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: passing more than one value to a SP

    Re-write the proc to use a table valued parameter and lock yourself into proprietary MS. Or you can Google us a set of two articles I did on long parameters...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Please give query for below output

    Can you be a bit more accurate in explaining your problem. You did show the same table as source and destination. Is it really what you want? Is tblKit is...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Please give query for below output

    venkidesaik (8/22/2012)


    Thanks for all replying to my post

    NOW IAM CLEARLY EXPLAING MY TASK,

    SELECT DISTINCT ID FROM TABLE1

    When i execute the above statement

    The Output comes like this,

    ID

    ----

    100

    200

    300

    400

    500

    so now i want to...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Update table based on column grouping

    That is easily achieved if you follow: http://www.sqlservercentral.com/articles/Best+Practices/61537/

    You're not first-timer, aren't you? 😉

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 1,321 through 1,335 (of 2,894 total)