Forum Replies Created

Viewing 15 posts - 13,066 through 13,080 (of 14,953 total)

  • RE: How to tranpose rows into columns

    You can do this with the pivot/unpivot commands. I recommend against it. Use Excel or Report Services.

    Set up Excel with a database connection and a view of the...

    - 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: which is more secure for file deletion, sp_OACreate or xp_cmdshell

    I'd use xp_CmdShell, then make sure to call it with a specialized login that has severely limited rights.

    - 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: Hey

    In SQL 2000, what you're looking for are the system tables. Pop those open, including in master (in system databases), find the columns you're looking for, query them.

    For example,...

    - 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 to Delete a Folder using an xp_cmdshell extended procedure

    Actually, it doesn't matter what version of SQL Server you are using. xp_CmdShell issues command shell scripts to Windows. Like the old DOS commands (if you're old enough...

    - 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 to write CROSS JOIN using subquery?

    Actually, I'm not sure there is any sane way to cross join two tables without using cross join.

    I can imagine that you could create a temp table, with all the...

    - 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: Default value based on case?

    You can use CASE in calculated columns (which is what this is). The problem isn't the first "AS", it's the second one. You can't alias a computed column...

    - 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: Poor Performance temporarily fixed by rebuilding indexes.

    Heap tables or poorly designed clustered indexes is the first thing that comes to my mind.

    If, for example, the clustered index is on an alpha column, and inserts regularly 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: Optimal Drive usage (Raid-5 and Raid-10 allocations)

    The first question is, are these databases OLTP or OLAP?

    For transactional databases (OLTP), with lots of updates, inserts and deletes, having the data files on RAID-1/10/01 is almost...

    - 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 to implement the functiionality of SWITCHOFFSET in SQL server 2005?

    Sure. Build a table of time zones and their offset, and query against that. Pretty simple, actually. And can be used in joins for set-based calculations.

    - 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: Show plan cache use by database..?

    If the other databases were in much heavier use than the one, yeah, they might very well end up taking over most of the cache.

    More often, though, there are other...

    - 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: Syntax problem

    Why not rewrite this:

    SELECT * FROM (

    SELECT ROW_NUMBER() OVER (ORDER BY Col1) AS RowNum, * FROM (

    SELECT TOP 100 PERCENT * FROM TableA ORDER BY Col1

    ) X

    ) Y

    WHERE RowNum BETWEEN...

    - 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: date conversion

    Try this:

    SELECT [Incident date]

    FROM dbo.base_clinical

    where isdate([Incident date]) = 0

    That will give you the rows where it can't convert that column to a date. From there, you can probably figure...

    - 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: Need help with an UPDATE statement.

    The basic way to do this is to select the customer, the question, and the max date in a derived table or CTE, then join to that on all three...

    - 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: Parent Child - Deadlocks

    You might take a look at isolation levels in Books Online. Might find a solution in there. I don't know one off the top of my head.

    - 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: Bulk Insert and Index Considerations

    Toby White (6/30/2008)


    ...My recommendation to them on Friday was to place the clustered index on zip like you guys suggest, but why not drop all indexes and just recreate the...

    - 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 - 13,066 through 13,080 (of 14,953 total)