Forum Replies Created

Viewing 15 posts - 7,876 through 7,890 (of 8,731 total)

  • RE: Error converting data type varchar to numeric

    My guess is that one of the columns bd.SORTUSER_EMPID or ed.[Employee ID] is numeric and the otherone is a varchar and contains a non-numeric value. This error would be caused...

    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 with temp table based on previous row value

    This looks a lot like a running total issue. read the following article and come back if you still need help.

    Solving the Running Total and Ordinal Rank Problems [/url]

    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: Order By trouble

    You still don't have NULL values on your sample data. However, check what I did with the alias for your column.

    Select ISNULL(Value, 'Not Defined') as newValue

    from #mytable

    ORDER BY...

    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: search values in a temp table with like operator

    You should really try the 8K Splitter[/url]. However, your code won't perform great because SQL Server might not generate the best plan for your query.

    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: IF ELSE Query

    latingntlman (7/22/2013)


    Correct, Luis.

    I wanted to see how many records were inserted.

    Then you could simply use

    SELECT @@ROWCOUNT

    Beware of the possible resets of the @@ROWCOUNT value.

    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: Date convertion

    Why do you want to format your dates in your table? You should store them as dates and format them until you display them.

    Is this a datetime column? or 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: JSON Search not finding expected article

    I usually have this problem when I'm searching a specific article. A good way is to get to them by entering the Authors section.

    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 add column and then sum

    You don't even need the CTE, you could just add the SUM() OVER() to your original query.

    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: IF ELSE Query

    Do you just want to know how many rows were inserted? You could consider @@ROWCOUNT or the OUTPUT clause.

    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: mssql split column string into rows

    The best way is to use the 8K Splitter.

    Check the following article 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: PIVOT-ing solution needed for diary viewer

    Maybe you want something like this or maybe I'm misunderstanding you. Feel free to correct me 🙂

    SELECTu.Username,

    MAX( CASE WHEN DAY( r.EntryDate) = 1 THEN EntryStatus ELSE '0' END) AS Day01,

    MAX(...

    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: Syntax error in Dynamic SQL - SQL Server 2000

    There's no way to mark it as solved or closed (unless you're an administrator).

    I will make emphasis on avoiding the use of functions in your queries. Your query won't 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: TOP 1 for each employee

    Yes you can. I just have personal preference for CTEs. 😉

    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: Syntax error in Dynamic SQL - SQL Server 2000

    Checking your code, I found that you could make some improvements to it. But to help you, we'll need the definition of the webproxylog5 table and user_parser function. And some...

    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: Syntax error in Dynamic SQL - SQL Server 2000

    You have some problems with your quotes. I'm not sure that I did the right corrections. Use the print to run the query that gets printed and debug from it.

    use...

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