Forum Replies Created

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

  • 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...

  • 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...

  • RE: Split values in 12 months

    You mean like this?

    Select Region,

    Amount / 12 AS Jan2015,

    Amount / 12 AS Feb2015,

    --...

    Amount /...

  • 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, ...

  • 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...

  • RE: Finding Azure SQL Database

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

  • 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 =...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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.

  • RE: Simplifying while loop query

    rs80 (10/14/2015)


    But doesn't CROSS APPLY have a different purpose than CROSS JOIN?

    Yes, it allows you to reference columns from the previous tables to use in correlated subqueries or functions.

    In this...

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