Forum Replies Created

Viewing 15 posts - 2,536 through 2,550 (of 4,080 total)

  • RE: Grant Access to a View without access to the Tables?

    Having reread the last part of your last post: Yes, you did, Elliott. 🙂

    I saw your opening line about not really suggesting it and thought your entire...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Changing Time in a Datetime Field

    declare @yourdate datetime

    set @yourdate = GETDATE()

    select @yourdate

    -- here is the syntax for the most efficient execution (avoids converting to char and back)

    select DATEADD(DAY,DATEDIFF(day,0,@yourdate),0)

    --...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Array Parameter using AND

    This seems a little clunky, but I think it does what you want.

    declare @array table (value int primary key)

    insert into @array

    select 1 union all

    select 2 union all

    select 4 union...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Crosstab view/query

    No problem. Good luck to you.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Crosstab view/query

    I think I must be misunderstanding your last post. The "hardcoded" names were just used to create some sample data. Any query that results in three...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Crosstab view/query

    You're welcome Regina. To understand what is happening, I suggest you walk through it one step at a time to see the outputs from the CTEs, what...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Crosstab view/query

    This was another fun problem, and a great morning warm-up. The trick here was to use ROW_NUMBER() to provide a sequence number so that you could have unique...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: find the position of the charcter in delimited string

    Most of the credit goes to Jeff. He taught me everything I know about Tally tables.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Using TOP and count in single query

    Do you understand why the ORDER BY compels the execution of a full table scan? The only way I think you could improve on that would be the...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: temp table syntax

    Quite likely.... and in the end, she solves her own problem. 😛

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Crosstab view/query

    Regina, do you just require the names of the contacts, or do you need email address, phone numbers, etc?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: temp table syntax

    In a word: Doh! :w00t:

    Man, I am really off my game.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Grant Access to a View without access to the Tables?

    We're on the same server right? I was thinking you'd just create the view in the SAME db as the tables, and grant access only to that...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Grant Access to a View without access to the Tables?

    In a word: Yes.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: find the position of the charcter in delimited string

    Jeff:

    I have a question for you. I originally tried to do the whole problem without the working table, but I kept getting an error that an invalid...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 2,536 through 2,550 (of 4,080 total)