Forum Replies Created

Viewing 15 posts - 6,136 through 6,150 (of 8,731 total)

  • RE: How To update and Join Table With Cursor???

    Prudhvi _SQL (7/15/2014)


    HI tri_hartanto,

    ...

    UPDATE R

    SET R.Unmort = CASE WHEN ISNULL(R.Unmort,'-') = '-' THEN '0' ELSE R.Unmort END,

    R.Total = CASE WHEN ISNULL(R.Unmort,'-') = '-'...

    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?

    GilaMonster (7/15/2014)


    Jeff Moden (7/15/2014)


    Lynn Pettis (7/15/2014)


    OMG, how can someone who has been working with SQL Server for over 9 years still behave like an entry level DBA/Developer??

    Whose turn with 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 update and Join Table With Cursor???

    I must be sincere, I can't guarantee this method and you should test it thoroughly before implementing it. This method is documented in the following article and you should read...

    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: Querying multiple tables within a database

    You just need to add more columns to your query.

    It might look something like this:

    SELECT p.name,

    p.anyothercolumns,

    n.idnumber,

    ...

    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: Querying multiple tables within a database

    Using a JOIN.

    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: Merge in stored procedure

    There's no problem for us if you post it here. However, this site is focused on SQL Server and you might not get the best answers. You should try an...

    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 more than two columns

    You could easily use CROSS TABS to pivot your data.

    Read the following article and come back if you need extra help. 😉

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    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 would I tune this query?

    You need to realize that excluding the wildcard (%) will generate different results. It doesn't matter if the query runs 1000x faster if the results aren't correct.

    The leading wildcard 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: How would I tune this query?

    Read this to get better answers for performance questions.

    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: Fill in Missing Data

    This will deduplicate the rows that have missing values. However, if the duplicate rows are the majority, I might use a different approach.

    INSERT INTO @DiamondsMissingData

    SELECT '6157560941C','Crown','CR50135','GIA',6157560941,35588000,177940,NULL UNION ALL

    SELECT '6157560941C','Crown','CR50135','GIA',6157560941,35588000,NULL,27375500 UNION...

    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: Isolating a list with pattern search

    Maybe something that's been more tested could help. 🙂

    WITH bug (BugID, BugComment) AS (

    SELECT 1, 'Hello DB_001000, DB_001000, DB_001000 Blick'

    ...

    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: Datatype

    You need to format the string.

    SELECT CAST( STUFF( STUFF( STUFF( '2013-05-24-20.03.46.843480', 11, 1, 'T'), 14, 1, ':'), 17, 1, ':') AS datetime2(7))

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

    I'm posting a different option that will read the table just once. It might be faster but I can't assure that. I included an option with ISNULL which will work...

    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: Manager and Employee Hierarchy

    You're missing information. There's no way to relate employees with managers in the sample data posted.

    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: Merge in stored procedure

    Are you working in Oracle or SQL Server?

    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,136 through 6,150 (of 8,731 total)