Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)

  • RE: Execution Plan

    If you run SET SHOWPLAN_TEXT ON before your query, you'll get a bunch of hideous text that I believe is the equivalent of the hideous graphical output of Query Analyzer...

  • RE: T-SQL to Text File How to?

    If you want something a little more low-tech, there's good old osql at the command line. You can pass it a query and specify delimiters, etc. Use the -w switch...

  • RE: More efficient way

    Or, try this. I would guess performance will be the same, but it's less typing.

    select top 1 2003 from adm.activitylog

    where start_date >= '2003-01-01' and start_date < '2004-01-01'

    union all

    select top...

  • RE: More efficient way

    This is a case where brute force is your friend:

    select Year

    from (select 2003 as Year,

      cast('2003-01-01' as smalldatetime) as StartYear,

      cast('2004-01-01' as smalldatetime) as EndYear

     union all

      select 2004 as Year,

      cast('2004-01-01' as smalldatetime),

      cast('2005-01-01' as...

  • RE: Databases with no transaction logs

    I don't know if this might help, but make sure you're setting your batch size to... something. How this is done varies by whether you're using bcp or DTS or...

  • RE: Crosstab -- eliminate rows with all zeroes

    select strBusinessFunction,

           SUM(CASE WHEN strCondItionStatus ='A'and strTestPlan = @TestPlan  THEN 1 ELSE 0 END)AS 'A',

           SUM(CASE WHEN strCondItionStatus ='U'and strTestPlan = @TestPlan THEN 1 ELSE 0 END)AS 'U',

           SUM(CASE WHEN...

  • RE: Convert table into a crosstab table in SQL Server

    create table #Source_Table (ITEM char(1), SOURCE char(2) )

    insert into #Source_Table

    select 'a', 'aa' union all

    select 'a', 'bb' union all

    select 'b', 'cc' union all

    select 'b', 'dd' union all

    select 'b', 'ee'

    select ...

  • RE: Fetch Server Name into DTS Package

    >>You can do it via vbscript...<<

    Keep in mind, though, that if you have a named instance, or multiple instances, or a clustered server, that the name of the NT Server...

  • RE: Removing Time from Date

    select cast(cast(cast(cast(getdate() as binary(8)) as binary(4)) as binary(8)) as datetime)

    "getdate()" used as an example of a date.

    Cast it to binary(8). Cast that to binary(4) -- that lops off the right...

  • RE: Oracles LPAD / RPAD equivalent

    convert(char(2), getdate(), 3)

    less typing

    Chris Hofland

  • RE: at the breaking point. (in more ways than one)

    I'm too lazy to check BOL, but off the top of my head, I believe the rule is that when SQL Server compares two strings (char/varchar) the shorter of the...

Viewing 11 posts - 1 through 11 (of 11 total)