Forum Replies Created

Viewing 15 posts - 6,916 through 6,930 (of 8,731 total)

  • RE: Query help

    I can't find the problem you mention. Maybe the sample data is wrong.

    WITH tbl_source AS(

    SELECT Col2, Col3

    FROM (VALUES('abc','123454321'),

    ('abc','12345678-ABC'),

    ('abc','10123456789'),

    ('abc','10123456789-A'),

    ('abc','11199999999'),

    ('abc','11122222222-X'))x(Col2, Col3)

    )

    SELECT Col1 = CASE WHEN LEN(col3_num) > 10 AND col3_num LIKE '111%'...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Help on Calculation of days between Start & End Date (Including BOTH the Start & End Dates)

    dhananjay.nagarkar (2/14/2014)


    D I wrote a code as below but I'm not sure will it work or not , if not please advice me the right code to accomplish this.

    ------ My...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Parametros desde un sp en 2008

    prueba http://www.portalfox.com/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: calculating daily running balance

    You should change your function to an inLine table-valued function to improve performance.

    CREATE FUNCTION dbo.GetDates(@from AS DATETIME, @to AS DATETIME)

    RETURNS TABLE

    AS

    RETURN

    WITH E1(N) AS(

    SELECT N FROM(VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(N)

    ),

    E3(N) AS(

    SELECT a.N FROM...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Data migration from Excel to SQL

    What's the question or the point of this post?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Count with Year,Month,Week

    You could post DDL, sample data and expected results to get better answers. I'm sure you've been told how to do that.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Selective SELECT on data

    Here's a possible solution for you. Be sure to understand it and ask any questions you have.

    UPDATE t SET

    Tag = 1

    FROM #temp1 t

    WHERE ExpDate = '2014-03'

    AND Symbol IN( SELECT x.Symbol...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Why sql does not follow the order of the instructions as I wrote, like in sql2000?

    The method you use was subject to fail even with 2000. The best solution as always is to normalize the data.

    As you can imagine, every option will need code changes,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: regarding replace function

    Why do you believe that replace is causing performance problems?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Must Declare Scalar Variable Error with IN Clause ?

    That's not the best option. SSRS has an option to send the parameters in a way that can be evaluated as necessary within the IN clause.

    I don't remember how to...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Sean Lange (2/13/2014)


    So the little one decided to share the flu with both mommy and daddy. I am so glad we teach our children to share. I am about a...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Can you dynamically create a temp table?

    To do a dynamic pivot, check the following article: http://www.sqlservercentral.com/articles/Crosstab/65048/

    If you build your table something like this, it doesn't matter if you have 1, 3 or 200 results:

    CREATE TABLE Quiz_Results(

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Can you dynamically create a temp table?

    Yes you can with dynamic code. But you might face the same issues when calling that table. Why wouldn't you want to use a normalized temp table?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Time Format issues

    I'd go a little further and get the data as time.

    declare @timevar int

    select @timevar = '145345'

    select CAST( STUFF( STUFF( right('000000' + cast(@timevar as varchar(6)), 6), 5, 0, ':'), 3, 0,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Parametros desde un sp en 2008

    elkinfortiz (2/13/2014)


    He implementado un Proc. Almacenado que retorna un consecutivo compuesto. Ej:TA-1. Requiero obtenerlo via ODBC. He intentado de varias formas pero lo he podido capturar.

    Alguien tiene una idea de...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 6,916 through 6,930 (of 8,731 total)