Forum Replies Created

Viewing 15 posts - 5,431 through 5,445 (of 8,731 total)

  • RE: t-sql 2012 not using parameters correctly

    Take a look at Gail Shaw's article on catch-all queries.

    http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/

    If you have any questions, come back and we'll help 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: Deathly Performance with Sql Server Query

    After analyzing your query and Eddie's, I keep wondering what are you trying to accomplish. This can certainly be a major problem with cartesian products. Could you post DDL, sample...

    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: STUFF Function

    mhildebrand (12/5/2014)


    David Burrows (12/5/2014)


    SELECTv.Vchvendor, SUM(vgl.vglamount) AS [VGLamount],

    STUFF((SELECT ','+ b.vchinvoicenbr

    FROMVoucherGLDist a

    JOIN Voucher b ON b.VchVoucherNbr = a.VGLVoucher

    WHERE b.VchVendor = v.Vchvendor

    FOR XML PATH ('')),1,1,'') AS [Invoices]

    FROMVoucherGLDist vgl

    JOIN Voucher v ON...

    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: Crosstab help

    Why cross tab if a simple aggregate works?

    SELECT ID,

    MAX(Red) AS Red,

    MAX(Yellow) AS Yellow,

    MAX(Green) AS Green

    FROM Sometable

    GROUP BY ID

    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 determin FILEGROUP on my DB in SQL Server

    Are you asking for something like this?

    SELECT fg.name AS filegroup, df.name AS filename, df.physical_name

    FROM sys.filegroups fg

    JOIN sys.database_files df ON fg.data_space_id = df.data_space_id

    If not, I feel like there's a language barrier.

    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: Hard Drive Config

    Data files as .mdf for primary and .ndf for secondary. SQL Server only uses the transaction log and the files are .ldf.

    Data files are organized in filegroups, and log files...

    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: Subquery incorrect syntax error

    Evil Kraig F (12/4/2014)


    GilaMonster (12/4/2014)


    Alex Jordan (12/3/2014)


    I figured it out. Apparently I can order sub-queries as long as I provide a alias.

    Nothing to do with the ORDER. Derived tables always...

    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: Split the data without loop

    You can find the answer in 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: Assigning multiple rows to a single variable parameter

    Could you post the definition of the function Adv_Returntranscationsbytype or what should it do?

    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: Function to Case Text within a Field

    Yes, I made a mistake by not including the 2nd parameter of LEFT function. You should have been able to solve it by yourself.

    =UCase(Left(Fields!Event_Type.Value,1)) & LCase(Right(Fields!Event_Type.Value, Len(Fields!Event_Type.Value) - 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: Function to Case Text within a Field

    shelts (12/4/2014)


    Thanks to all who replied, neither scenario appears to work though 🙁

    Why not? If you get more details, you could get better answers. 😉

    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: First Day and Last day of the previous month in ssis expression

    That's normal, because you're still calculating the days for November. If you understand each part of the formula, you should be able to fix it yourself. To use different months,...

    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: Select Distinct - but only on a joined table

    You just need to change some things and the 4 options are still available to test. 😉

    SELECT c.ContactName, e.EmailAddress, MIN( e.EmailID) EmailID

    FROM #tblContacts c

    INNER JOIN #tblEmails e ON c.ContactID =...

    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: Select Distinct - but only on a joined table

    I can think on several different ways to accomplish this. I'm not sure which one is the best on your scenario. Could you test and tell us which one and...

    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: First Day and Last day of the previous month in ssis expression

    What do you mean by "doesn't work"? Error? Incorrect results? Detonates atomic bomb?

    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 - 5,431 through 5,445 (of 8,731 total)