Forum Replies Created

Viewing 15 posts - 6,886 through 6,900 (of 8,731 total)

  • RE: Simple Tsql scenario - Please help

    I found 2 options that might help. Test them to find out if they work fine with your real data.

    --Using CTE and ROW_NUMBER()

    WITH CTE AS(

    SELECT *, ROW_NUMBER() OVER( PARTITION BY...

    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: Are the posted questions getting worse?

    Steve Jones - SSC Editor (2/18/2014)


    Ed Wagner (2/17/2014)


    EL Jerry (2/17/2014)


    G'Day Everyone!!

    Have you noticed the community has grown over 1.7M members?

    Congratulations to Steve et al who founded it, keep...

    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: Query all schemas.

    You could also create a view with all the schemas.

    I can't imagine why would you have all those schemas.

    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 a column into several columns by delimiter

    In the last test I did, pivot and cross tabs perform the same with a single aggregate. For multiple aggregates, cross tabs will be quite faster.

    I still prefer the flexibility...

    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: Question on joins

    The only difference I can find is in the join between SalesOrderDetail and SalesOrderHeader. The problem is that I would believe that the first option is correct and the second...

    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: Time to Retire

    Jim P. (2/18/2014)


    Markus (2/18/2014)


    I can understand both sides of it really... the thing is a furnace, washer, car doesn't run completely on software that needs to be patched every single...

    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 use of CTEs in Query - asking for comments on how to improve query

    Your query is quite complex (or at least long). I have no idea why do you have all those UNION ALL if you're always querying the same tables (maybe 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: Replacing multiple characters in a string Dynamically

    This might work for an iTVF. But I'm not sure is the best option with real data.

    Note that it uses the DelimitedSplit8K that you can find here along with 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: Need Help With Coalesce

    Colonel_Derp (2/17/2014)


    Luis Cazares (2/17/2014)


    Could you try something like this: http://www.sqlservercentral.com/articles/comma+separated+list/71700/ ?

    If you post DDL and sample data, we should be able to help you.

    DDL? Do you mean direct download link,...

    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: SQL Server Stored Procedure are argument for Select where value IN Statement

    This should give you a similar output to what you have now. As Sean said, more information could help us help you.

    CREATE FUNCTION [dbo].[FoldersOfFile](@theFileID int)

    RETURNS TABLE AS

    RETURN

    ...

    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: SQL Server Stored Procedure are argument for Select where value IN Statement

    You can't use a stored procedure like that.

    You have several options and you need to choose what's best for you.

    To use the SP you can use INSERT INTO:

    CREATE TABLE #TempTableForThis(...

    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: Need Help With Coalesce

    Could you try something like this: http://www.sqlservercentral.com/articles/comma+separated+list/71700/ ?

    If you post DDL and sample data, we should be able to 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: Time to Retire

    Or I can marry and move out 😀

    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: Time to Retire

    Nadrek (2/17/2014)


    Luis Cazares (2/17/2014)


    Nadrek (2/17/2014)


    Luis Cazares (2/17/2014)


    It's easy to take family members off of WinXP. Not so easy for companies that need lots of licenses and testing time to make...

    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: Exchange Rate Interval

    Something like this?

    SELECT currency, AVG( xr.xchange_rate)

    FROM cur_range cr

    JOIN xchange_rate xr ON cr.currency = xr.currency_code

    AND xr.xchange_date BETWEEN cr.from_date AND cr.to_date

    GROUP BY currency

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