Forum Replies Created

Viewing 15 posts - 7,936 through 7,950 (of 8,731 total)

  • RE: complex joins retrive the echivalent results

    Could you please post your sample data as DDL statements? I'll give you an example but right now, I don't have time to do it with all the tables. This...

    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: Denormalizing into a grid

    The output you posted doesn't match with the output of my query using the sample data, but it does what you need.

    The articles mention numeric data but it's the same...

    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: Denormalizing into a grid

    I'm afraid that there's something wrong with your sample data. However, you could do something like this.

    SELECT productdate,

    MAX(CASE WHEN personname = 'Jasper' THEN productname END) Jasper,

    MAX(CASE WHEN personname = 'Milo'...

    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: A little help needed with simple Custom Function

    Maybe you could use something like this. The CTE is just to have some sample data to test with.

    WITH SampleData(String) AS(

    SELECT 'Doe, John, H *^' UNION ALL

    SELECT 'Doe, John, H,...

    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: A little help needed with simple Custom Function

    The problem is you're using double quotes instead of single quotes.

    However, you should really avoid doing a simple replace with a UDF as it will degrade performance in a horrible...

    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: Store Procedure running slow

    To get better help on performance problems, please read the following article. I'm sure someone around here will help you to solve the problem.

    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    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: Extract String between Special characters

    The best way that comes to my mind is to use the 8K Splitter. Read the following article and come back if you need help.

    http://www.sqlservercentral.com/articles/Tally+Table/72993/

    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: multipart identifier could not bound

    Are you checking on the same server and database? (it has happened to me more than once)

    Are you sure the spelling of the alias is correct?

    Have you refreshed the Intellisense...

    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: How to solve

    Jeffrey Williams 3188 (7/9/2013)


    Not sure if this will perform any better - but is another way of generating your tally table and a calendar.

    You may want to take a look...

    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: Another Case Statement ???

    Erin Ramsay (7/8/2013)


    Don't we have to work on the assumption that enddt is never going to be null? If that's the case (no pun intended) then the case statement will...

    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: Another Case Statement ???

    Maybe an example will show how it works and it will be up to you if it does what it is supposed to do.

    DECLARE @test-2 TABLE(

    DischargeDatedatetime NULL,

    enddtdatetime NULL)

    INSERT @test-2 VALUES

    ('20130101',...

    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: Another Case Statement ???

    What are you trying to figure out? What if you think the other way around?

    CASE

    WHEN CONVERT(varchar(8), DischargeDate, 112) < CONVERT(varchar(8), enddt, 112)

    ...

    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: Check if Function EXISTS before adding

    As CREATE PROCEDURE or CREATE FUNCTION must be the first line of a batch (except for comments), the only way to do it is through dynamic SQL. In fact, the...

    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: How to solve

    Basically is the same method but using a different Tally approach to have zero reads.

    declare @date1 datetime

    declare @date2 datetime

    set @date1='20130801'

    set @date2='20130807'

    ;WITH E1(N) AS (

    ...

    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: How to solve

    Do you mean something like this?

    SELECT DATEDIFF(dd, @date1, @date2)

    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 - 7,936 through 7,950 (of 8,731 total)