Forum Replies Created

Viewing 15 posts - 4,261 through 4,275 (of 8,731 total)

  • RE: change name

    Reformatting full names is a pain and something you can't really automate in the real world without some problems. Take this example:

    SELECT LEFT(FullName,CHARINDEX(' ',FullName)-1) AS x

    ,RIGHT(FullName,LEN(FullName)-CHARINDEX('...

    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: Find string with spaces and replace them with other string

    This might work as a different approach. Comments before the CREATE statement might give wrong results, but should work better than your previous option.

    SELECT STUFF( definition, CHARINDEX('CREATE ',definition), 6, 'ALTER')...

    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 on excel file generation through backend

    Even with SSIS, I'm not sure that formatting is possible without some code on a Script Task.

    Another way to do it is by creating a Macro in Excel and run...

    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 Windowed Partitioning Help

    As you're reading all the rows from YTD, I guess a single scan should perform better.

    Be sure not to get lost on what this is doing. Since you're using 2008,...

    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: hi, i'm a noob on sql 2008 could anyone suggest me on how to do it

    You should read about aggregate functions. There are many places to read, but you can get a quick start by using the Stairway to T-SQL DML on this site[/url].

    Your query...

    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: Create dates right on the hour interval-best technique

    Sean is using cascading CTEs to create a tally table. A tally table allows you to work with rows that are numbered.

    In this case, Sean included 100 000 rows...

    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 improve this query

    Emil B (9/4/2015)


    was this ROWS/RANGE "hint" available in 2008/R2?

    No, neither the ORDER BY for window functions.

    But the Quirky Update is supposed to be even faster. For more information: http://www.sqlservercentral.com/articles/T-SQL/68467/

    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: Make sure that the required parameter is set - error

    Go to the parameters tab on the source and destination objects (not the connections) and define names for the parameters. If I remember correctly (as I don't have SSIS right...

    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: Make sure that the required parameter is set - error

    Are you using parameters for your source query?

    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: Ranking with Groupings

    And here I was trying to figure out how to keep the posted order.

    CREATE TABLE #Test(

    ID int IDENTITY(1,1),

    Name varchar(20),

    ...

    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: CONVERT BUG ?

    mar.ko (9/3/2015)


    Luis Cazares (9/3/2015)


    Not really strange as it converts to an int within the IIF before being converted to a bigint.

    the problems caused by ISNUMERIC

    No excuse on Microsoft's part....should have...

    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: Exporting rows to an excel spreadsheet beginning in a specific column and row

    You could use cross tabs to create the recordset with the help of the ranking functions.

    I'm not in the mood of creating the whole scenario, but it can certainly be...

    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: Getting error in bcp when importing comma delimited data file

    halifaxdal (9/3/2015)


    The import process took less than half an hour and complete like an amazing miracle, and with no error even for the last line.

    Thank you very much Luis for...

    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: Getting error in bcp when importing comma delimited data file

    halifaxdal (9/3/2015)


    Luis Cazares (9/3/2015)


    halifaxdal (9/3/2015)


    I found the issue:

    The data row contains comma in one of the column, which makes the bcp thinking it is a delimiter.

    Maybe I need to re-generate...

    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: CONVERT BUG ?

    Not really strange as it converts to an int within the IIF before being converted to a bigint.

    I would try a different approach knowing the problems caused by ISNUMERIC[/url].

    CREATE TABLE...

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