Forum Replies Created

Viewing 15 posts - 136 through 150 (of 215 total)

  • RE: Date Dimension

    There are many situations when you can use built in functionality to determine the day of the week or the month of the year and so have no apparent need...

  • RE: Are #temptables unique?

    Thanks.

    I hadn't realised that it was possible to create constraints (PK, unique) on table variables so that's something else I learnt today.

    Jez

  • RE: Are #temptables unique?

    Andras,

    Are you suggesting that #temp tables are preferable to table variables?

    Jez

  • RE: Joining two numbers

    Yes you can have this as part of your query:

    declare @owner varchar(5), @contract varchar(6)

    set @owner = '2345'

    set @contract = '123'

    select right (replicate('0',20) + right (replicate('0',5) + @owner,5) + right (replicate('0',6)...

  • RE: Union Query in Reverse

    As an alternative to a NOT IN query, you could use a left outer join:

    select t1.ident_type_id as Form1_IDs

    from form_ident_types t1

    left outer join form_ident_types t7

    on t1.ident_Type_id = t7.ident_type_id

    and t7.form_id = 7

    where...

  • RE: Are #temptables unique?

    If you are concerned about whether #tables are unique (and I think that they are), then use table variables instead.

    There are a few differences such as you have...

  • RE: Large loads from Oracle to Oracle accomplished via SQL Server 2000 DTS

    Which of the steps takes the longest time?

    As an alternative, why not download the required data from the second Oracle db into SQL Server and do the merge processing in...

  • RE: SQL2005 vs Teradata

    I echo what Scott said.

    I don't believe the client tools for Teradata are as good as for SQL Server. The only real tool available is the equivalent of Query...

  • RE: count non null values

    If you want a single result then something like this would do:

    select sum (

    case when is not null then 1 else 0 end

    + case...

  • RE: Huge Table - Must Archive

    There are a few options that I can think of.

    1.  Create a copy of the empty table, copy in the last 60 days data, rename the tables so that the...

  • RE: Can anyone point out what''''s the problem of my sp? Thanks.

    Can you post details of the error?

    I suspect that the problem is due to the scope of the temp table #t.  Effectively, the sp_executesql is a nested stored procedure and...

  • RE: xp_cmdshell

    Have you considered xp_sendmail?  Have a look at Books On Line.

     

    Jez

  • RE: How can I improve this SQL query

    I was replying to the original post in that doesn't a min()/count(*) with a group by give the same results and would be faster than the original query.

     

    Jez

  • RE: Delimiter of string data

    If you want to continue with the original idea (I'd missed out some end of brackets):

    set @col004 = substring(@col004, charindex(dbo.gettoken(@col004,',',2), len(dbo.gettoken(@col004,',',2) + 2)), len(@col004))

    The other solution would almost certainly...

  • RE: How can I improve this SQL query

    I've probably missed the point entirely but does this do it:

    select

    distinct 'CONV 1' as Conveyour,

    info as error,

    min (substring(timecreated, 0, 7)) as date,

    count(*) from 'Times Occured'

    from log

    where loggroup = 'CSCNV'...

Viewing 15 posts - 136 through 150 (of 215 total)