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

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

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

  • 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

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

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

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

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

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

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

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

  • 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

    ;

    ...

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

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

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

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