Forum Replies Created

Viewing 15 posts - 5,806 through 5,820 (of 14,953 total)

  • RE: A way to script all DBs from a server

    You can query sys.databases, or you can use sp_MSForEachDB.

    - 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: BCP without xp_cmdShell

    You could use CLR instead of xp_cmdshell. You could use a job that calls the command line. Either will work.

    - 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/Code change after Partition

    I don't think you'll have to change code at all. That's kind of the whole point of partitioning a table.

    Test it in your Dev/Proof of Concept environment.

    - 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: The Need for New Technology

    To expand on the "discovering what we already know" point:

    A company I used to work for knew that a lot of time was being wasted by back-and-forth between Order Fulfillment...

    - 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 Excel collation strugles

    I'm not clear on what you mean. Do you mean you want to get rid of the accents on characters, or are you having problems with accents going away...

    - 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: Split string of concatenated words

    Here's a reasonably performant version. Assumes you have a Numbers table. If not, search for Numbers table and Tally table, and you'll find how to create one, 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: Computed column as a primary key?

    There's a slim but real chance of hash collision, even if the data is different. What will you do if that comes up? Just hope it doesn't?

    - 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: Using CASE in a WHERE clause

    Chris Morris-439714 (12/3/2010)


    GSquared (12/3/2010)


    select *

    from dbo.MyTable

    where @Parameter = 'A'

    or (ParentTradeID is not null and @Parameter = 'O')

    or (ParentTradeID is null and @Parameter = 'R');

    Wouldn't that do it?

    Hey Gus, reckon...

    - 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: Using CASE in a WHERE clause

    Sachin Nandanwar (12/3/2010)


    Cant you just use IF blocks ?

    Why would you bother? Use the Where clause. That's what it's there for.

    - 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: Using CASE in a WHERE clause

    select *

    from dbo.MyTable

    where @Parameter = 'A'

    or ParentTradeID is not null and @Parameter = 'O'

    or ParentTradeID is null and @Parameter = 'R';

    Wouldn't that do it?

    - 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: Update Table If Record Exists Else Insert ?

    If you're using SQL 2005 (as per the forum you posted in), then you do a two-state "upsert", which just means you do an update on matched records, and 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: Pulling out rows in specific groups

    Paging functions in queries can be a bit of a problem.

    Are you using SQL 2000, as per the forum you posted in, or is there any chance you're using 2005/2008?...

    - 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: Regular Expressions in Find and Replace in SSMS?

    Can you just use a LEFT() expression on each row, up to the first comma?

    - 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: Remove the first character of a string

    Are you absolutely certain the pipes at the beginning of the row don't mean the first column is empty/null? I've seen delimiters do that before, in that case.

    - 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: rename instance

    You'd have to reinstall as the default instance, so far as I know.

    - 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,806 through 5,820 (of 14,953 total)