Forum Replies Created

Viewing 15 posts - 6,751 through 6,765 (of 8,753 total)

  • RE: Nested FOR XML PATH

    Quick runnable demonstration on the flexibility of FOR XML PATH

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    ;WITH BASE_DATA(BD_ID,BD_VAL) AS

    (SELECT * FROM (VALUES

    (1,'ABC')

    ...

  • RE: Suddenly not able to connect to Sql server

    Quick thought, in command prompt run "net start", the sql server instance will show up in the output if running, if not, start the instance.

    😎

  • RE: Query logic help please

    clayman (10/17/2014)


    The reason why I split the string is that I want to order the Ids, eg.

    DECLARE @INPUT_STR VARCHAR(50) = '101,102,103,108';

    will be the same as

    DECLARE @INPUT_STR VARCHAR(50) = '103,102,101,108';

    I...

  • RE: Column name with spaces is not working

    Quick suggestion, create a view with compliant names, i.e. replace spaces with underscores, then specify the proper field name in the report. There is a three year old Connect entry...

  • RE: SQL server newbie

    jonen (10/3/2014)


    Hi. I've just started a new job and working with Access databases, but these are getting very close to the 2gb size limits. My predecessor simply created a new...

  • RE: Performance of 'OR' in a where clause

    Quick suggestion, try two separate queries, one for each email table and combine the results using union all.

    😎

  • RE: Query logic help please

    clayman (10/17/2014)


    Excellent, thank you.

    You are very welcome. Out of curiosity, what do you use for splitting the incoming parameters?

    😎

  • RE: Query logic help please

    Quick suggestions since Id's can be shared by Categories

    😎

    USE tempdb;

    GO

    DECLARE @t TABLE (Id INT)

    INSERT INTO @t

    SELECT 108 UNION ALL

    SELECT 102 UNION ALL

    SELECT 103 UNION ALL

    SELECT 101;

    DECLARE @t2 TABLE (CategoryId INT,...

  • RE: Query logic help please

    ...and another solution using the pre-split-string table

    😎

    USE tempdb;

    GO

    DECLARE @t TABLE (Id INT)

    INSERT INTO @t

    SELECT 101 UNION ALL

    SELECT 102 UNION ALL

    SELECT 103 UNION ALL

    SELECT 108;

    DECLARE @t2 TABLE (CategoryId INT, Id INT)

    INSERT...

  • RE: Query logic help please

    Quick solution for SQL Server 2012 and later, replaces also the split into @t

    😎

    USE tempdb;

    GO

    DECLARE @t2 TABLE (CategoryId INT, Id INT)

    INSERT INTO @t2

    SELECT 2, 50 UNION ALL

    SELECT 2, 51 UNION...

  • RE: Nested FOR XML PATH

    Quick thought, remove the FOR XML from the nested query.

    😎

  • RE: xml openrowset performance

    First suggestion is to add one step where the files are directly loaded into a staging table as an XML blob, without any shredding or processing. This will give you...

  • RE: Slow running SQL server.

    You are absolutely right Gianluca, the source of the problem has to be determined before applying any fixes. What I left out in the previous post was of course using...

  • RE: Slow running SQL server.

    davidwarner (10/16/2014)


    BTW i read i shouldn't make any changed to maxdop or cost of parra during business hours as SQL will dump the plan cache?

    That is correct, so be careful!

    It...

  • RE: Slow running SQL server.

    Quick thought, the cost threshold for parallelism is way too low, would suggest setting it to 50 for a start. Can you provide more information on the setup?

    😎

Viewing 15 posts - 6,751 through 6,765 (of 8,753 total)