Forum Replies Created

Viewing 15 posts - 9,346 through 9,360 (of 13,469 total)

  • RE: Convert Julian date to Gregorian date

    i have a different conversion in my notes: what format are your dates actually in?

    DECLARE @jdate int

    SET @jdate = 109252

    --in AS400/DB2 date is 01/01/1900 + 109 years + 252 days

    select...

  • RE: create a stored procedure to create a database

    Dan i poked around the net trying to find out the ramifications of why TRUSTWORTHY on master database might be a bad idea, and it just comes right back...

  • RE: no.of concurrent connections to SQL instance

    run sp_who or sp_who2;

    every spid greater than 50 is a user connection.

  • RE: Trace table inserts/updates

    what value did you put in for the path to the file, N'\\server\folder\Trace',

    if it is not a local directory, but a UNC path, you might have problems depending on...

  • RE: Simple scalar function slows down query

    ok tomas, a couple of things;

    scalar functions can slow things down, as they introduce a hidden cursor/REBAR...million rows=million function calls.

    I've changed your function froma scalar(called once per row) to a...

  • RE: How it matters adding filters in table joins?

    Suresh excellent job on posting a complete example, thanks!

    in this case, you want to compare the actual execution plans to see if it makes a difference.

    in your example, they produce...

  • RE: query on old employee table

    another way without the UNION:

    select

    CASE

    WHEN manager='Y'

    THEN 1

    ELSE 2

    END

    as myorderBy,name,salary

    from sometable

    ORDER...

  • RE: Opening Internet Explorer Using SQL-CODE

    oh yeah we are on the same page. there's another thread on CLR that got me all excited becasue i got it to work to read a web page...for...

  • RE: query on old employee table

    select 1 as myorderBy,name,salary from sometable where manager='Y'

    UNION ALL

    select 2 as myorderBy,name,salary from sometable where manager='N'

    ORDER BY myorderBy,salary

  • RE: Date Comparison Problem

    it's all good; i just moved the WEHRE statment into a CASE so i could print a status:

    SIGNING_DATEENTRY_DATETimeStatus

    2010-05-01 00:00:00.0002010-05-04 00:00:00.000On Time Signing

    2010-05-01 00:00:00.0002010-05-07 00:00:00.000On Time Signing

    2010-05-01 00:00:00.0002010-05-10 00:00:00.000Exception Not within...

  • RE: Delete parent record

    you can't without breaking referential integrity.

    Otherwise you'd be dropping the foreign key constraint, or disabling the foreign key constraint so it would be invalid after you deleted the parent record.

    maybe...

  • RE: Date Comparison Problem

    still the same idea, i think; for example the week of today is 22:

    select datepart(week,getdate())

    so biz day wise, m-f of this week is 22, m-f of last week is 21;

    so...

  • RE: Convert Julian date to Gregorian date

    pinky i guess the question is what do you want to do if the date is invalid?

    return NULL?

    SELECT

    juliandate,

    CASE

    WHEN juliandate LIKE...

  • RE: Opening Internet Explorer Using SQL-CODE

    Gopi Muluka (5/27/2010)


    Did you tried this?

    Exec xp_cmdshell '"C:\Program Files\Internet Explorer\iexplore.exe"'

    the problem with that is it will spawn an iexplorer instance, but not clean up after itself...after one hour, you'd have...

  • RE: Date Comparison Problem

    jared here's an example i think can show you the idea;

    you want to use BETWEEN two dates, and use DATEADD to determin the range based on another date:

    --results

    SIGNING_DATEENTRY_DATE

    2010-05-01 00:00:00.0002010-05-04 00:00:00.000

    2010-05-01...

Viewing 15 posts - 9,346 through 9,360 (of 13,469 total)