Viewing 15 posts - 12,211 through 12,225 (of 14,953 total)
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/
August 21, 2008 at 11:33 am
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...
August 21, 2008 at 11:25 am
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),...
August 21, 2008 at 11:21 am
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...
August 21, 2008 at 11:17 am
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. ...
August 21, 2008 at 11:14 am
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...
August 21, 2008 at 11:11 am
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...
August 21, 2008 at 11:07 am
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...
August 21, 2008 at 11:04 am
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...
August 21, 2008 at 11:01 am
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.
August 21, 2008 at 10:58 am
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...
August 21, 2008 at 10:56 am
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...
August 21, 2008 at 10:55 am
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...
August 21, 2008 at 10:52 am
What type of column is it?
August 21, 2008 at 10:49 am
Chirag (8/20/2008)
HiI 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...
August 21, 2008 at 10:47 am
Viewing 15 posts - 12,211 through 12,225 (of 14,953 total)