Viewing 15 posts - 20,416 through 20,430 (of 22,197 total)
Huh, I wonder why that's running slow. 😀
Sorry, that's not nice. Actually, except for the enormous set of columns in the GROUP BY, this isn't too bad a query based...
May 9, 2008 at 5:43 am
Rollback the transaction before you insert into your audit table. Here's a sample using Adventureworks:
BEGIN TRY
BEGIN TRANSACTION
UPDATE [HumanResources].[Department]
SET [Name] = NULL
WHERE [Name] IS NOT NULL
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
INSERT INTO dbo.[AuditLog]...
May 9, 2008 at 5:35 am
Just a quick follow-up. It looks like, based on the code you posted, that you're missing the concept of part of the UPDATE statement. You went inline on both your...
May 9, 2008 at 5:30 am
Great article Yoda: "you'll never wrong go by creating a primary key on a table, temp or not"
Seriously though, I find the resistance to your thoughts that, with a VERY...
May 9, 2008 at 5:21 am
Hey Sandy,
Are you getting lazy in your old age? 😉
Just go over to the MS web site and you'll get all the marketing stuff you need. Here's the page to...
May 9, 2008 at 5:14 am
You should look into breaking down your process into smaller steps. Insteading of processing one million rows (or whatever it is) as a single transaction, run them hundred thousand row...
May 9, 2008 at 5:10 am
I've always loved love writing. I hated English class in school because I thought, and still do, the teachers were, let's say, less than adequate to their jobs and more...
May 9, 2008 at 5:06 am
@@ERROR is resolved individually for each statement. So a bit of your code:
CREATE TABLE test1(testint int, oooo)
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0
BEGIN
As long as the GO...
May 8, 2008 at 10:44 am
Take a look at INFORMATION_SCHEMA.PARAMETERS. It's a system view in your database.
May 8, 2008 at 6:45 am
Ah, I see where the problem might be:
(SELECT DISTINCT con.[ConsultantID]
...
May 8, 2008 at 6:44 am
Piling on at this point, but what the heck...
TSQL is easy. WAY TOO EASY.
Developers look at it, learn the syntax and, as far as they're concerned, they're done. What they...
May 8, 2008 at 6:27 am
One guess. When running the query from Management Studio, do you have hard coded parameters like this:
DECLARE @MyParm int
SELECT...
FROM dbo.View
WHERE SomeColumn = @MyParm
Then of course the proc might look...
May 8, 2008 at 6:11 am
VARCHAR(MAX) probably needs to be streamed to ODBC, but I would think the max value would be a page worth of data, 8000, not 256 characters. I haven't seen a...
May 8, 2008 at 5:56 am
Don't bow. You're right. 100%.
I think most of us have been focused on the indexes. I'm still a bit bothered by the cluster being on such non-selective columns. It's not...
May 8, 2008 at 5:36 am
GSquared (5/7/2008)
antonio.collins (5/7/2008)
user defined procs in master. ewww!Yeah, that's why I create a Common database for that kind of thing.
Same here. Don't put this stuff in master. Don't...
May 8, 2008 at 5:31 am
Viewing 15 posts - 20,416 through 20,430 (of 22,197 total)