Viewing 15 posts - 13,291 through 13,305 (of 14,953 total)
Actually, Joe used ANSI joins. The second query is a cross-join with two Where statements. That's standard.
(Have to admit, I don't like the layout he used, but that's...
June 18, 2008 at 11:50 am
Well, you can do something like this:
;with CTE as
(SELECT *
FROM #office_info_by_location_id
PIVOT (MAX(total_offices) FOR month IN ([2008-03],[2008-04])) AS temp)
select location_name,
isnull([2008-03], 0) as [2008-03],
isnull([2008-04], 0) as [2008-04]
from cte
June 18, 2008 at 11:46 am
First, I'd change from using create and update dates to using the timestamp/rowversion data type. Otherwise, if the process ever fails one night (power outage or whatever), it can...
June 18, 2008 at 11:40 am
Version 1 has to create a worktable, put the data in there, then move it from the worktable to the temp table. Insert...Exec always works that way, so far...
June 18, 2008 at 11:11 am
If you can post a copy of the proc, we can probably help you figure out what's causing the recompiles.
June 18, 2008 at 10:59 am
This:
create clustered index guid_index_ind on guid_index (guid)
Needs to be:
create unique clustered index guid_index_ind on guid_index (guid)
That should solve your problem.
June 18, 2008 at 10:57 am
CTEs can be used in dynamic SQL scripts. Just has to be SQL 2005, pretty much.
If you want to look them up in Books Online, search for "Common Table...
June 18, 2008 at 10:48 am
The main advantage to backup-restore vs detach re-attach is that backup-restore only requires you to move one file (the backup file) from one server to the other. If you...
June 18, 2008 at 10:46 am
I'm not sure what method you are using to save the scripts, but if you right-click a proc in Management Studio, select Script Stored Procedure as -> CREATE to ->...
June 18, 2008 at 10:37 am
Don't do it that way. That turns it into RBAR (Row-By-Agonizing-Row), which will slow it down big time.
What I meant was something like this:
;with NotesTopStamp (TNumber, TopStamp) as --...
June 18, 2008 at 10:33 am
Try/Catch can only catch procedural errors. It can't handle compilation errors. That's what you're running into here.
You'll need to catch the error from the code calling the proc.
June 18, 2008 at 9:33 am
GSquared (6/18/2008)
This made me think about how I would go about creating a family tree or history database with years outside the...
June 18, 2008 at 9:21 am
They would both treat the score of 0 the same way.
The difference is simply that Rank will skip numbers after ties, while Dense_Rank won't.
For example, if you have 3 people...
June 18, 2008 at 9:17 am
liam.stirling (6/18/2008)
GSquared (6/18/2008)
June 18, 2008 at 9:10 am
Front end or insert proc should test for validity.
This made me think about how I would go about creating a family tree or history database with years outside the range...
June 18, 2008 at 8:36 am
Viewing 15 posts - 13,291 through 13,305 (of 14,953 total)