Forum Replies Created

Viewing 15 posts - 12,211 through 12,225 (of 14,953 total)

  • RE: Avoiding cursor in a cumulative sum

    Here's a good article on running totals without cursors.

    You could easily add into the case statement something about the total being greater than b.

    Edit: http://www.sqlservercentral.com/articles/Advanced+Querying/61716/

    - 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: DBName quandry

    You could set it up as dynamic SQL. Have the database name be a variable, concatenate it into the commands, then execute them as strings.

    declare @DBName nvarchar(126), @Cmd nvarchar(1000)

    select...

    - 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: varchar(MAX) or nvarchar(MAX) not satisfying my requirement

    You have to cast/convert the strings to varchar(max) BEFORE you concatenate them, or it will cut them off.

    Something like this:

    declare @MainString varchar(max), @Substring1 varchar(8000), @Substring2 varchar(8000)

    select @substring1 = replicate('=', 8000),...

    - 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 Express - Quad core cpu woes

    I wonder if it's the type of CPU you're using. I've installed SQL Express on a quad-core "Core 2 Extreme" machine, and it ran on all four cores.

    Also, 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: Optimal servers setup for SQLSvr05, SSRS05, IIS

    Sounds like you're on the right track.

    I don't think you have to install SQL Server on the server with Reporting Services. I think you can install those separately. ...

    - 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: What's the best way to create à clustered index?

    I'd go with the suggestion of websiteID and logdate, but also keep in mind that you'll want to test the fill factor on that, since you won't get getting fully...

    - 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: Problems Installing Sql Server 2005 on Windows Vista Home basic

    Standard and Enterprise editions need a server OS, not a desktop OS. They won't install on XP, Vista, etc.

    You can set up a virtual server, install a server OS...

    - 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: Timestamp Data type Help...

    Microsoft misnamed the "timestamp" data type. It's actually a binary row version number, and is unique per-database. It updates every time you update the row.

    It's got uses, in...

    - 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: Line number in stored proc

    You can also use Ctrl-G to go to a specific line. Keep in mind that if you have all the usual stuff at the top of a proc, 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: task scheduler

    Is there a real reason not to use SQL Server Agent? It's going to be a lot easier to set up, monitor, maintain, etc., in there.

    - 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 every other ROW?

    Actually, you might want to use row_number() when you insert into the temp table, to force the sequence. Just add ", row_number() over (order by A.Name) as Row" to...

    - 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 every other ROW?

    Insert the whole thing into a temp table with an identity column. That way you only have to select it once, which will be better performance overall.

    Then select from...

    - 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: Upgrade MSDE to SQL 2005 Standard

    Set up the server, back up the databases from each of the MSDE servers/instances, restore them in the 2005 server. Test that they work. It really should be...

    - 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: can not decrease avg_fragmentation_in_percent

    What type of column is 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: Optional BEGIN...END keywords when creating procs

    Chirag (8/20/2008)


    Hi

    I agree its part of a mindset but using them makes it clear where procedure starts and ends... Especially when you have lot of Control flow statements.

    I always thought...

    - 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 - 12,211 through 12,225 (of 14,953 total)