Forum Replies Created

Viewing 15 posts - 3,736 through 3,750 (of 8,731 total)

  • RE: find duplicate loginame

    Something like this?

    SELECT login_name

    FROM sys.dm_exec_sessions AS DES

    GROUP BY DES.login_name

    HAVING COUNT( DISTINCT DES.host_name ) > 1

    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: Newbie help! Grouping by date

    If you're working on Access, the syntax might be slightly wrong. However, the logic is there so you can correct it.

    If you're working on SQL Server, you should change your...

    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: The dotted table

    sknox (11/24/2015)


    Hugo Kornelis (11/24/2015)


    The correct answer is missing: "The table doesn't have a primary key". It's also suspect that all columns are nullable.

    From the answer options I deduced that I...

    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: String Compare

    ningaraju.ne 46825 (11/24/2015)


    Thanks Buddy,

    But still issue exists as it fails when we compare normal strings.

    DECLARE @C NVARCHAR(10),@R NVARCHAR(10)

    SELECT @C=N'Ant'

    SELECT @r=N'ant'

    IF @r = @C COLLATE Latin1_General_Bin

    SELECT 1

    ELSE

    SELECT...

    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: Use of SP_

    ben.brugman (11/24/2015)


    So I create a stored procedure starting with a sp_ in the name.

    In general the advise is not to do this.

    In general, the advise is to avoid naming stored...

    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: The dotted table

    Maybe "What's wrong with this table?" should be change to something like "What's wrong with the syntax of this statement to create a 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: Where clause prevents index seek

    The problem in here is the query. Other than adding hardware, there's no other viable solution.

    If they're labeling the file name with an underscore, it's fine, but they don't need...

    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: need to help query in sql server 2008

    You could use RANK instead of ROW_NUMBER. That might lead to a different problem when you have duplicate rows in patientref.

    If you have an additional column that deduplicates the row,...

    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?

    Brandie Tarvin (11/23/2015)


    Luis Cazares (11/23/2015)


    Is it me or many people don't really understand error handling or why and how to use try...catch...?

    It's not just you. Though, to be fair, Try...Catch...

    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?

    Is it me or many people don't really understand error handling or why and how to use try...catch...?

    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: Running Stored Procedure from agent and shows successful even when it fails

    If it gets into the CATCH, and the CATCH doesn't have a RAISERROR. Then, the agent won't consider the error.

    Either you use RAISERROR or you use THROW. Otherwise, when you...

    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?

    Brandie Tarvin (11/23/2015)


    Luis, you are a better person than I am. I have no desire to keep encouraging the OP to ask for the query, so I am not answering...

    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: need to help query in sql server 2008

    My guess is that you can't have the proper indexes for the query to run correctly. The query needs to sort the patientref each time, which is what might be...

    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: need to help query in sql server 2008

    From what I understood from your problem, it seems that you were really close to the solution. You need to use the APPLY approach because you need to correlate your...

    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: Running Stored Procedure from agent and shows successful even when it fails

    Does it really throws an error? Or does it just displays a message as configured in the TRY...CATCH...?

    Are you using THROW?

    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 - 3,736 through 3,750 (of 8,731 total)