Forum Replies Created

Viewing 15 posts - 6,451 through 6,465 (of 8,731 total)

  • RE: No error when Sub query not valid

    hisakimatama (5/16/2014)


    For this reason, it's strongly recommended to always qualify your subquery column names, lest a highly-confusing error crop up at some point 🙂

    +1000

    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: Daily CSV

    I would go with SSIS as well, but if you want to do it with Powershell, there are plenty of examples in the web.

    A search on google for "powershell export...

    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: Remove Null

    I would suggest to restrict your query to only find those 2 values.

    Select distinct

    Case when P.Dept_Value = 'Accounting' Then 'AccountingPerson'

    When P.Dept_Value = 'ITServices' Then 'ITPerson'

    End Type

    From PesonDept P

    WHERE P.Dept_Value IN(...

    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 error: Copy direction must be either 'in', 'out' or 'format'

    Put the query and file between double quotes and it should work.

    bcp "select * from TRAFICO1.dbo.HECHOS_TRAFICO_DATOS_PREPAGO_201308_5338_5347" queryout "\\trafico\Historicos_Tablas\PLANOS_TRAFICO\HECHOS_TRAFICO_DATOSPREPAGO_201308_5338_5347.txt" -c -t"|" -Strafico\traficosql -T

    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: String or binary data would be truncated.

    viresh29 (5/16/2014)


    Here is the script to copy table structure from temp to target.

    CREATE TABLE TagetTableName

    AS

    SELECT TOP 0 * FROM TempTableName.

    That's a bad design solution as no one should have a...

    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: String or binary data would be truncated.

    I never spoke about a real temp table (#table), I just followed the description that you used.

    I must not have explained myself clearly. I made an example to show 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: How to use "placeholder technique"

    Here's another option. It works with the sample data and I would expect it to work with real data as well. The only difference is with det_YY column which 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: String or binary data would be truncated.

    You need DDL for your target table. And use some code like this:

    SELECT *

    FROM Temp_Table

    WHERE LEN( string_column1) > length of string_column1 in target table

    OR LEN( string_column2) > length of string_column2...

    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: Compare Comma seprated values of two table in sql server 2005

    You should be aware that if you use a varchar(MAX) column a input to the DelimitedSplit8K function, you can have silent truncation.

    Other than that, it's a great function.

    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: Comma Separator Delimiter

    Jeff Moden (5/15/2014)


    Luis Cazares (5/15/2014)


    crmitchell (5/15/2014)


    farooq.hbs (5/14/2014)


    I found the solution..

    LEFT([field], CHARINDEX(',', [field]) - 1)

    :):):)

    Thanks:-):-):-):-)

    That will work if you are certain that your source string will ALWAYS contain at least...

    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 help needed

    I thought that it was clear that I posted an example of a bad design just to show you how to include the BETWEEN on 3 different tables as 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: Displaying Time Differnece Between 2 DateTime Fields > 24 Hours

    You might want to check this article as well. 😉

    http://www.sqlservercentral.com/articles/T-SQL/103343/

    It will explain how does this work.

    DECLARE @StartDT DATETIME

    ,@EndDT DATETIME

    ;

    ...

    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 help needed

    CELKO (5/14/2014)


    I disagree. In typography and visual psychology there is a principle called the Law of Proximity; the basic idea is that things in proximity on a plane are grouped...

    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: Comma Separator Delimiter

    crmitchell (5/15/2014)


    farooq.hbs (5/14/2014)


    I found the solution..

    LEFT([field], CHARINDEX(',', [field]) - 1)

    :):):)

    Thanks:-):-):-):-)

    That will work if you are certain that your source string will ALWAYS contain at least one comma. If 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: Replace variable emails in long sting with blank@blank.com

    Maybe the DelimitedSplit8K can help you with this. You could split, change the emails and rejoin the string.

    Here's an example:

    CREATE TABLE #Test(Somestring varchar(8000))

    INSERT #Test VALUES('<set type="TomAgingAlertProperties"><TomAgingAlertProperties><properties><USE_AGING_CALENDAR value="true"/><CALENDAR_INT value="206"/><AGE_PRE_PAYMENTS value="true"/><AGE_AS_APPLIED value="true"/><OTHER_LIST...

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