Forum Replies Created

Viewing 15 posts - 76 through 90 (of 122 total)

  • RE: should this t-sql raise error?

    Although I'm not sure why you would want to do this there is a way. You can create a stored procedure which calls your exec('create view...') statement.

    create...

  • RE: Deleting and locking...

    Do you have the option to temporarily map an external drive and set the tempDB to use that drive during this process?

  • RE: Slow unions

    If you are using a UNION instead of a UNION ALL that is a performance hit as well. UNION returns distinct rows of data so you have to deal...

  • RE: Export data from a sql table to excel sheet

    Look into OPENDATASOURCE in Books Online. That should get you started

  • RE: Bizarre Ordering Behavior

    Another interesting point, if you modify the query like this:

    select P.fldYear as JIMMY, cast(P.fldYear as varchar) +

    case when P.fldStage > 2 then ' Final' else ' Initial'...

  • RE: Sum of previous rows till this row.

    Jeff, quick question. Since I used a clustered index couldn't I "assume" that the order would be as I want it?

    I know to never assume...

    ST

  • RE: I need this Values

    Ah, very cool indeed.

    Thanks

  • RE: I need this Values

    Gail, I'm confused as to why to use the datediff function.

    declare @dt datetime

    set @dt = '1/31/2008'

    -- 2 months out

    -- Note that this adds 2 to the...

  • RE: Sum of previous rows till this row.

    I knew I remembered a way to do this with variables!

    Credit where it's due, Jeff showed me this a while ago. It took me a while to remember it.

    set...

  • RE: Sum of previous rows till this row.

    Is this a better approach, Jeff?

    set nocount on

    set statistics io on

    set statistics time on

    -- Drop if necessary

    drop table #tbl

    create table #tbl (IID int identity(1, 1), num int)

    create clustered index tmpIndexIID...

  • RE: Sum of previous rows till this row.

    Ashwin M N, please forgive the flames but it had to have taken you longer to write that the answer didn't match your requirements than it would have taken for...

  • RE: Sum of previous rows till this row.

    create table #tmp (fldID int identity(1, 1), fldNum int)

    insert into #tmp (fldNum)

    select 1 as x union all

    select 2 as x union all

    select 3 as...

  • RE: Correlated Sub Query (RBAR WTF?)

    Ken is correct. I apologize that my original queries were incomplete. Here is a query which demonstrates my point:

    set statistics io OFF

    set nocount on

    CREATE TABLE #foo (

    ...

  • RE: Correlated Sub Query (RBAR WTF?)

    Unfortunately it did need tableA in the two sub queries. As I was posting pseudo code I didn't include the many other joins in the sub queries. I...

  • RE: Correlated Sub Query (RBAR WTF?)

    Thanks, Jack. I have lots of options as to how to correct the issue. I was interested in a discussion as to why the query would create the...

Viewing 15 posts - 76 through 90 (of 122 total)