Forum Replies Created

Viewing 15 posts - 3,526 through 3,540 (of 8,731 total)

  • RE: Extracting tables from SPs

    You have your logic inverted

    SELECT OBJECT_NAME(referenced_major_id) AS referenced_object_name

    ,COALESCE(COL_NAME(referenced_major_id, referenced_minor_id), '(n/a)') AS referenced_column_name

    ,*

    FROM sys.sql_dependencies

    WHERE object_id = OBJECT_ID('YourStoredProcedureNameAndSchema')

    ORDER BY referenced_object_name, referenced_column_name;

    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: Extracting tables from SPs

    river1 (1/19/2016)


    When I try to use that I get empty back. No records returned

    Can you post the code that you're using?

    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 from daterange?

    Here's the approach that I would take. Note that I changed the pivot to cross tabs. The reason behind this is that it will perform better as you only 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: Joining Tables with Right Function

    johnwalker10 (1/17/2016)


    SELECT column_name(s)

    FROM table1

    RIGHT OUTER JOIN table2

    ON table1.column_name=table2.column_name;

    Try to read the question before posting and, if possible, the previous posts. Also test code against sample data and compare it 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: Multiple Records into one

    Ed Wagner (1/16/2016)

    I've never seen the technique produce inaccurate results. Can you provide an example of where it screws up? I'm incredibly curious.

    I've seen it happen once when...

    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: Joining Tables with Right Function

    Some options:

    - You're missing an alias,

    - You have a space where you shouldn't,

    - You're missing a comma,

    - If you're using dynamic code, the single...

    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?

    Grumpy DBA (1/15/2016)


    Another celebrity death. For those old enough to remember the TV show Grizzly Adams actor Dan Haggerty has died at age 74.

    Wonder if Ramsey scored a goal...

    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: Insert a suffix to the values

    Orlando Colamatteo (1/15/2016)


    guy 1966 (1/15/2016)


    Ok, I finally found what I needed

    UPDATE `categories_images` SET `categories_image`=REPLACE (`categories_image`,'.gif','');

    UPDATE `categories_images` SET `categories_image`=REPLACE (`categories_image`,'','');

    Thank you!

    @guy1966, I am not sure why you insisted on getting 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: Joining Tables with Right Function

    Another option.

    SELECT *

    FROM #tb_1 t1

    JOIN #tb_2 t2 ON t1.SKU1 LIKE t2.SKU2 + '-__'

    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: Inner join vs outer join

    RayMan007 (1/15/2016)


    Luis, Thank You!! 😀

    Make sure that you don't need an additional condition on your join to get a backup date for each database instead of one per server.

    You might...

    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: derived column error

    arkiboys (1/15/2016)


    Eirikur Eiriksson (1/15/2016)


    arkiboys (1/15/2016)


    Hello,

    Using the foreachloop I loop through excel files to get the filename andthen start loading the data into sql server using oledb...

    1- I get 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: Inner join vs outer join

    How about doing something like this:

    SELECT ch.ServerName,

    ch.DatabaseName,

    ch.DbId,

    ch.error,

    ch.MessageText,

    ...

    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: LEFT JOIN

    A possibly bad idea is to change an option in your PK index. Specifically IGNORE_DUP_KEY.

    This will prevent errors from happening when inserting duplicates to a table, but will also hide...

    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: Today's Random Word!

    SQLRNNR (1/14/2016)


    amn't (ask Steve about that one!)

    ain't (nobody got time for 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: Multiple Records into one

    Considering that you're working with SQL 2000, an option could be using a scalar function. I'm not sure that the order will always work, but it's an option.

    CREATE TABLE tblNOTES(

    ...

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