Forum Replies Created

Viewing 15 posts - 14,851 through 14,865 (of 14,953 total)

  • RE: SQL - Derived Tables

    Reginald J Ray Jr (1/16/2008)


    Derived tables are cool as far as being able to write elegant code and reduce the quantity of code. I started using them for these...

    - 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: Moving Databases into different drive

    If you are worried about moving all the files correctly, write the file moves as a .BAT file before-hand, then run that once you have detached. That becomes your...

    - 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: Problem with Dynamic SQL

    Parameterizes sp_executesql! Of course! (I knew I was saying something stupid in my prior post on this one.) Yeah, do that.

    - 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: returning data for a given month

    Jeff Moden (1/14/2008)


    Heh... Keep in mind that the BETWEEN examples are rarely correct because they don't allow all times of the day to be included or they mistakenly include...

    - 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: New Company, new DBA Tools budget, can you recommend any?

    A bat with a nail? How primitive! I want a taser, preferably with a laser-sight on it (even if it doesn't work at a distance)! I have...

    - 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: Naming Convension

    On index names, I use a three-character code to indicate the type of index, then the table name, then a description, separated by underscores.

    E.g:

    IDX_Customers_Name on dbo.Customers(LastName, FirstName, MiddleName)

    CID_Customers_Name on dbo.Customers(LastName,...

    - 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: Naming Convension

    I use camel-case for table names, and use underscores in the names of procs where I would use a period if it were an OOP language.

    For example:

    Customers

    CustomersEmail

    would be 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: Temporary tables within an IF statement

    Of course, my solution only works if the table definition is different depending on what the variables do in the IF statements.

    If you have a single table definition, just define...

    - 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: Temporary tables within an IF statement

    The only way I know to do this is to define the temp table before the IF statement. Here's an example that might work for you:

    create table #T1 (ID...

    - 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: Making a table out of a list

    Please see:

    http://www.simple-talk.com/sql/t-sql-programming/the-helper-table-workbench/

    for a better way to accomplish this same task (and a few others). It's faster, and takes less CPU resources.

    - 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: Problem with Dynamic SQL

    I haven't had to solve this before, so there might be a better solution, but here's a suggestion that might work.

    In the calling procedure (the one that builds the SQL...

    - 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: returning data for a given month

    Keep in mind that the one with "between" will be much easier on the server than the ones that have functions in the Where clause.

    Also, unless you've already handled this...

    - 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: How many hours are you expected to work?

    Some employers expect more than 40 per week, but with poor reason.

    The 40-hour week isn't arbitrary. If you look at the history on it, extensive experimentation and study have...

    - 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: New Company, new DBA Tools budget, can you recommend any?

    Apex tools I use and like: Diff, Log, Report, Doc

    I have licenses for some of the others, but don't find I use them that much. Their Edit and Code...

    - 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: New Company, new DBA Tools budget, can you recommend any?

    Redgate has some great tools.

    Also check out ApexSQL (www.apexsql.com). Similar to Redgate. Some overlap, some differences, some it's hard to tell the difference without checking the logo.

    - 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 - 14,851 through 14,865 (of 14,953 total)