Forum Replies Created

Viewing 15 posts - 6,721 through 6,735 (of 8,731 total)

  • RE: Pasting Query Results into XL from SSMS 2012

    Ville-Pekka Vahteala (3/20/2014)


    And here is the English link.

    http://technet.microsoft.com/en-us/library/ms187323.aspx

    I'm sorry, sometimes I forget to change it.:-D

    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: Finding the longest string within a string field

    Based on that sample data. What should be the output?

    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: SSIS - For Each Loop

    I'm assuming that you know how to create a variable (If you don't please tell me).

    You have to ensure that your variable scope is set to the package.

    Then you add...

    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: Count 2 if met criteria

    You're right Jessie there are simpler and more effective ways to do this.

    SELECT SUM( CASE WHEN IDDM.ACTL_PROC_CD COLLATE Latin1_General_CI_AS IN('PP', 'P2') THEN 1

    WHEN IDDM.ACTL_PROC_CD COLLATE Latin1_General_CI_AS IN('RP', 'DR') THEN...

    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: More then one complaint by same customer

    You're welcome. Be sure to understand how and why does it work.

    I'm glad I could help.

    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: Pasting Query Results into XL from SSMS 2012

    Is CHAR(9).

    You need to remember that Books On Line is your friend 😉

    http://technet.microsoft.com/es-es/library/ms187323.aspx

    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: Pasting Query Results into XL from SSMS 2012

    This isn't a pretty solution, but have you tried using REPLACE?

    select top 300

    Avg_CPU_Time

    ,Total_Physical_Reads

    ,convert(datetime,Last_execution_time) as Timestamp

    ,Stored_Procedure

    ,REPLACE(REPLACE(Query_text, CHAR(13), ' '), CHAR(10), ' ') AS Query_text

    from dbadmin.dbo.History_CPU_IO_ByQueryAndSP

    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: SSIS - For Each Loop

    You could have a variable that changes its value inside the foreach loop and use it in the constraint after the loop.

    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: More then one complaint by same customer

    You could use HAVING clause to get what you need (there are other options as well).

    It's considered a good practice to post your sample data in a consumable format along...

    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: Checking varchar data to see if it can be cast as decimal

    You could try something like this:

    WHERE somecolumn NOT LIKE '%[^0-9.]%'

    This won't be completely safe as it will return false positives for values with more than one point(.).

    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: why we need *Data Flow Task* in SSIS

    Because that's the task designed for that purpose. What else would you 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
  • RE: empty string INSERTs as 0 to INT column - how to prevent it?

    That's an implicit conversion. You can check this:

    SELECT CAST('' AS int), CAST('' AS datetime), CAST('' AS bit)

    The question is what do you want instead of the zero? 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: Explicit Columns Or NULL Foreign Keys?

    I'm not sure about the best option, but I would say that using a single table adding columns for cancellation information.

    I wouldn't use a bit (it might be 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 can I get the minimum value for columns group per row ??

    Just wanted to add a different approach to unpivot explained in this article:

    http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/

    --Using MysteryJimbo data

    SELECT ID, ProductName, MIN(Cost) as MinCost

    FROM @test

    CROSS APPLY (VALUES(Cost1), (Cost2), (Cost3), (Cost4))Costs(Cost)

    GROUP BY ID, ProductName

    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: Is there an easy way to get the scripts of a table with only t-sql, not with the wizard?

    That was my point, but I didn't have an example ready. 😀

    I'm making the link clickable to make it easier for others.

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