Forum Replies Created

Viewing 15 posts - 5,431 through 5,445 (of 14,953 total)

  • RE: Double-hop solution and problem

    Domain access for the direct access, and SQL accounts used only for linked servers, gives a pretty good security model that's easy to administer. You can audit what you...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: is null check in where clause

    GilaMonster (1/5/2011)


    You lot are nuts.

    To misquote Obelix: These DBAs are crazy! 😀

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Tool to find permissions needed

    Run a trace to capture every command it issues to the database. From that, you'll be able to work out what tables, procs, etc., it is accessing. Then...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Query Performance Tuning

    Replace "Union" with "Union All", and you should have a decent query there. Not sure what you mean about replacing Union with Case statements.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Dynamic Column names based on value in other table.

    Go with one view per store, even if two stores are identical in their columns. That's not a good general database practice, but it sounds like the only practical...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Find average of last three months

    This is how I'd build something for that in T-SQL:

    -- Gets prior three months

    SELECT

    DATEADD(MONTH, -1, GETDATE()),

    DATEADD(MONTH, -2, GETDATE()),

    DATEADD(MONTH,...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Double-hop solution and problem

    Honestly, as complex as your solution and environment sound, I doubt anyone can give specific suggestions on this.

    I generally solve authentication double-hop issues by using SQL Server logins instead of...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: is null check in where clause

    GilaMonster (1/5/2011)


    parm_singla (1/5/2011)


    In general checking for nullablilty for parameter would be better than checking for nullablilty for the column.

    Errr... Depends completely on what you're trying to do. If you need...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Tool to find permissions needed

    Test Driven Development suggests running it and collecting the error messages, then fixing those.

    Otherwise, figure out what the tool will be doing, and where it will be doing it, and...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: SELECT INTO problem

    You can also add columns with an Alter Table command for temp tables.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: SQL to get specific table name that satisfy a condition

    Turn that query into a string in a variable. Replace "MyTable" with the value from the cursor. Execute it as dynamic SQL.

    declare @TableName varchar(255), @CMD varchar(1000);

    declare Tabless cursor...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Query Performance Tuning

    Views are tricky to index. Lots of rules on that.

    The better bet is to write out the query you really need in this, instead of using views.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Dynamic Column names based on value in other table.

    I'm assuming that different stores have different columns. If that's the case, you won't be able to have one view with all stores. Unless you include ALL columns...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: Script to Generate current_Id based on Parent value

    I can't see the image. Can you post code for the table?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • RE: SQL to get specific table name that satisfy a condition

    Create a temp table. Insert the table name (from the variable) into it, if no rows exist that fit the criteria. You can test for that with a...

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 15 posts - 5,431 through 5,445 (of 14,953 total)