Forum Replies Created

Viewing 15 posts - 4,021 through 4,035 (of 8,731 total)

  • RE: converting inline query into Join

    Both queries aren't equivalent. The first is a single value and the second one will show one value per LoanID. In both queries, there's no reason to use a subquery.

    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: Why does it take many minutes for this insert ? - Any siggestions

    I'm guessing that it could be an expensive sort if the index columns are not in the same order. Possible blocking on any of the 3 tables.

    Could you post 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: BCP utility Erroring

    Suth (10/16/2015)


    Spoke to one of our network guys and he said he will need to map the drive for it to be access. Which is causing my error.

    My last...

    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 values in 12 months

    You mean like this?

    Select Region,

    Amount / 12 AS Jan2015,

    Amount / 12 AS Feb2015,

    --...

    Amount /...

    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: Removing cursor..help please

    My wild guess would be something like this:

    CREATE FUNCTION [dbo].[eufn_e5_eSM_SE_GetCurrentContentForContainer]

    (

    @containerSqlId SMALLINT,

    @containerIncId INT

    )

    RETURNS TABLE

    AS

    RETURN

    SELECTCC.contentSqlId,

    CC.contentIncId,

    CC.contentMetaTableSqlId,

    CC.contentMetaTableIncId

    FROM [dbo].[ContainersContents] CC

    WHERECC.containerSqlId = @containerSqlId AND

    CC.containerIncId = @containerIncId AND

    CC.isDeleted = 0

    UNION ALL

    SELECT ccc.*

    FROM [dbo].[ContainersContents] CC

    CROSS APPLY [dbo].[eufn_e5_eSM_SE_GetCurrentContentForContainer](CC.contentSqlId, ...

    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 make query to calculate a dynamic formula ?

    As Sean said, this is an awful design. These should be columns instead of rows. All of these columns are totals and should be treated like that. The formulas can...

    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 Azure SQL Database

    I feel like I was obligated to get it right since I wrote the second article in the references. 😀

    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 help please?

    Quick option: Use cross tabs.

    select

    SUM( CASE WHEN category = 'cat1' THEN salesprice ELSE 0 END) AS cat1_salesprice,

    SUM( CASE WHEN category =...

    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: Newbie question - SQL server / development

    sa02000 (10/15/2015)


    Thank you for quick responses. Does it make a difference if I download 32 vs 64 bit?

    Jay

    Yes, 32-bit has several limitations listed in here: https://msdn.microsoft.com/en-us/library/ms143432(v=sql.120).aspx

    However, a 64 bit version...

    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 values in the column

    You could use the DelimitedSplit8k found in here: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    SELECT

    J.DT_ID

    ,J.InvNo

    ,sc.Item AS SalesCode

    ,a.Item AS Amount

    FROM @TEST_DATA J

    CROSS APPLY...

    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: Allow null on data type money?

    I wouldn't use nulls to represent a zero value. But I could see a valid option if there's an unknown value that might be defined later. You could also...

    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: Allow null on data type money?

    I wouldn't allow nulls on data type money for the simple reason that I wouldn't allow the money data type.

    Regarding the real question, I guess it depends more on 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: Newbie question - SQL server / development

    Phil Parkin (10/15/2015)


    Luis Cazares (10/15/2015)


    You can use either the SQL Server Express Edition which is free. It has several limitations, but for simple use, it should be fine.

    Where is 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: Row Count of each table

    For the row counts, you can use the following:

    SELECT OBJECT_NAME( object_id) AS TableName,

    SUM( row_count) AS Row_Count

    FROM sys.dm_db_partition_stats

    WHERE index_id IN(1,0)

    GROUP BY object_id

    For statistics and index maintenance, 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: Newbie question - SQL server / development

    You can use either the SQL Server Express Edition which is free. It has several limitations, but for simple use, it should be fine.

    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 - 4,021 through 4,035 (of 8,731 total)