Forum Replies Created

Viewing 15 posts - 11,281 through 11,295 (of 13,861 total)

  • RE: Cartesian product sql query

    It's not easy to understand what you are asking - can you provide sample input data, with desired output?

  • RE: Which is more efficient? WHERE SUBSTRING = ...or... WHERE fldField LIKE 'x%'

    GilaMonster (6/23/2011)


    There's a massive difference between the two.

    The first there's a function applied to the column. That makes the predicate non-SARGable, meaning SQL can NEVER use an index seek operation...

  • RE: Which is more efficient? WHERE SUBSTRING = ...or... WHERE fldField LIKE 'x%'

    As you are looking from the start of the column, you can use this

    WHERE LEFT(fldField,3) = 'NCB'

    - just a little tidier and avoids wildcards.

  • RE: char(10) and char(13)

    Here is proof that "it works"

    DECLARE @a CHAR(1) = CHAR(10)

    SELECT @a, ASCII(@a), REPLACE(@a,CHAR(10),' '), ASCII(REPLACE(@a,CHAR(10),' '))

    Now please try to explain how your problem is different from what has been suggested.

  • RE: Send mails at particular time in a batch process

    How large is 'large'? Do you want to do this internally (ie, using your own network/Exchange infrastructure), or use a third party (which you might, if large really is LARGE)?

  • RE: Formatting a date to YYYYMMDD

    Try something like this:

    DECLARE @a VARCHAR(20) = '010711'

    SELECT @a,

    '20' + RIGHT(@a, 2) + SUBSTRING(@a, 3, 2) + LEFT(@a, 2)

  • RE: Formatting a date to YYYYMMDD

    Jnrstevej (6/22/2011)


    Hi

    I'm trying to format the column(dueDate) which contains the date to a YYYYMMDD format

    My understanding to achieve this would be

    select convert(varchar,getdate(),112)

    select CONVERT(date,duedate,112)

    from test

    --my attempt

    select convert(varchar,duedate,112

    from test

    --Test table...

  • RE: Problem with year break between birthdate query

    Nasty.

    I've thought about the logic a little & this might work:

    If @StartDay <= @EndDay then

    where Day(Birthdate) Between @StartDay and @EndDay

    else

    where Day(Birthdate) Not Between @StartDay and...

  • RE: Execute Sql Task in SSIS

    Sachin4all (6/21/2011)


    Insert into hs(Id, Date, time)

    select utid,date,time

    from time t

    where transactiontime between ? and ?

    I have created the varibles startdate and enddate as datetime

    Sourcetype as directinput...

  • RE: Best way to alias column names

    You asserted it was okay to ommit readability because it's got no technical function in the post I replied to. I'm pointing out that that's specious.

    You continue to infer things...

  • RE: How to Left Justify Results

    I created your table, populated the data and then

    SELECT * FROM dbo.Onhand o

    - there is no right-alignment of anything.

    How are you getting the data out of SQL Server and into...

  • RE: Best way to alias column names

    No, I read your message correctly. What I disagree with is "...consider doing yourself a favor and omit the readability word...". Yes, it's only in there to make the written...

  • RE: How to Left Justify Results

    Jnrstevej (6/21/2011)


    Thanks for your replies

    To be honest i don't understand the script below, this returns 32 for me.

    declare @name varchar(256)

    set @name = ' 1231'

    select ascii(SUBSTRING(@name , 1 , 1))

    I...

  • RE: SSIS 2008 - Will not access UNC path from Job

    aaa-322853 (6/21/2011)


    Ok listen to this. If I set up a proxy account a link it to the SQL Server agent domain account it works?? Something is not quite right when...

  • RE: How to Left Justify Results

    Adding to that, trim removes spaces, so the characters to the left that you wish to remove must be something else. Step 1 is to find out what those characters...

Viewing 15 posts - 11,281 through 11,295 (of 13,861 total)