Forum Replies Created

Viewing 15 posts - 61 through 75 (of 82 total)

  • RE: Conversion to DATETIME

    Different way of doing the same thing. Slightly shorter code:

    select stuff(stuff(stuff(stuff(stuff(stuff(@eftv_dt,5,0,'-'),8,0,'-'),11,0,' '),14,0,':'),17,0,':'),20,7,'')

  • RE: Format to title case

    You could try something like this, which will curser through a table column, converting each row into title case, ie upper case the first letter of every word following a...

  • RE: Arithmetic overflow converting to int

    Yep, that makes more sense. Ignore my answer!

    Until this point I never realised that numeric allows greater calculating abilities than ints or bigints - doh!

  • RE: Arithmetic overflow converting to int

    Hmmm

    Well that's going to be a bit of a problem then.

    Basically you won't be able to do that calculation as is, as sql cannot calculate int values over the maximum...

  • RE: Arithmetic overflow converting to int

    Wrap each numeric part inside a cast as bigint statement. That should give you a few trillion to play with.

    select cast( as bitint) * cast(8192 as bigint) etc...

  • RE: Here's a fun one! :)

    So Antares686

    It sounds like you had an idea up your sleeve as to how to order a full rowed table like:

    SELECT * FROM TestC, TestC As TblA

    so,what was it,...

  • RE: Here's a fun one! :)

    In my keenness to post a reply, I neglected to join in the 'debate'

    The query uses a cross join

    select a, b, c, d, e

    from testC ,(select cast(newId() as varchar(50))...

  • RE: Here's a fun one! :)

    select a, b, c, d, e

    from testC ,(select cast(newId() as varchar(50)) as GUID) as B

    Order By GUID

  • RE: converting from a character string to uniqueidenti

    Try something like this:

    CREATE PROCEDURE spProcess

    @strDynTable char (30),

    @id int

    declare @sql varchar(8000)

    set @sql = '

    declare @tmpuid varchar(50)

    select @tmpuid = uid from '+ @strDynTable+' where id = '+ cast(@id as...

  • RE: Precise timing

    Consider it verified!

    In which case, can I revise my original post to "Can you time something that runs in less that three millisecond"...no never mind!!, Thanks for your replies

  • RE: Precise timing

    Well like I said, was more out of interest that a real need.

    But if you had a piece of code that could be written in two different ways, and both...

  • RE: Full-Text Search only Noise Words

    I don't know if others think this is a bad idea, but one option you potentially have is to remove the offending word from SQL's Ignored/Noice file, typically found in:

    \\SERVERNAME\c$\Program...

  • RE: Full text update -only when certain column updated

    Hi

    Thanks for replying.

    I like that idea, it only falls down if there is a single entry in the staging table, it will still do the full incrementation on all updated...

  • RE: How to format Date field?

    --Try:

    -- set up parameter

    declare @Date datetime

    set @Date = '01 jan 2002 12:00:00.000'

    -- convert date into text format

    select convert(varchar(30), @date, 106)

    --or take day part and pad with leading zero

    if len(day(@date)) =...

  • RE: GETDATE() in function - BUG

    Getdate() cannot be used in User Defined Functions (because it is not deterministic).

    I guess in this instance, the current date would have to be passed in as a parameter.

    ...

Viewing 15 posts - 61 through 75 (of 82 total)