Viewing 15 posts - 17,611 through 17,625 (of 49,552 total)
Restore from backup, that's not repairable.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 10:06 am
Also parameterise the call from VB, don't just concatenate a string together and execute it.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 10:01 am
I would recommend no using WITH LOG, except for critical errors. Otherwise just pollutes the SQL error log (which is where it's logged to) and makes it harder for the...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 10:00 am
rob.vig (7/16/2012)
I ran your simplified statement and it ran fine. No Error reporting though
No, there won't be any error reporting. As I said
If I writing the code, I'd probably build...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 9:22 am
Firstly let's fix your procedure. No need for dynamic SQL.
CREATE PROCEDURE [dbo].[GetPrintersByType] (@PrinterType INT)
AS
SELECT <column list here> FROM parameters WHERE printer_type & @PrinterType = @PrinterType
GO
Not familiar enough with VB to...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 9:15 am
rob.vig (7/16/2012)
How would this report the error?
It wouldn't. That's why I said there's a lot more that can be done, but that's the core.
If I writing the code, I'd probably...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 9:05 am
rob.vig (7/16/2012)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 9:03 am
rob.vig (7/16/2012)
Why all the "Why's"???
Because your code is over-complex for what it appears to be doing and I'm not sure if there's a reason for it or not. As...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 8:44 am
Without seeing how you're calling from VB, no.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 8:37 am
http://sqlinthewild.co.za/index.php/2011/05/17/on-transactions-errors-and-rollbacks/
Also, why the SAVE TRANSACTION? Are you expecting this to be called from a nested transaction? If so, why no checks of @@TranCount? What happens to the open transaction if...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 8:17 am
Not much detail to go on...
Put an TABLOCKX hint into the delete and do the delete and insert in a transaction.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 7:58 am
A where clause predicate has to compare some expression with some other expression.
Where Column1 > 4
Where Column1 + Column2/Column3 = 0
What you have there is
Where Column1
A single expression, no comparison....
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 7:33 am
ananda.murugesan (7/16/2012)
New version - SQL 2K8 R2 enterprise edition with SP2.
Sure about that? 2008 R2 SP2 has not been released, it's in CTP, and I would not suggest using a...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 7:13 am
Why are you using @@Error and goto and not the TRY ... CATCH error handling?
@@Error works, but it's more complex and easier to get wrong than try...catch
p.s BEGIN TRANSACTION immediately...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 7:07 am
tyson.price (7/16/2012)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 16, 2012 at 6:01 am
Viewing 15 posts - 17,611 through 17,625 (of 49,552 total)