Viewing 15 posts - 48,571 through 48,585 (of 49,552 total)
Be careful with IsNumeric. It returns true for some values that cannot be converted to int.
SELECT
ISNUMERIC('1,234.00'), 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
We stand on the bridge and no one may pass
July 9, 2007 at 3:22 am
Stupid questions, I know, but have you checked to make sure that
1) The table is there
2) The name is spelt correctly
3) It's in the dbo schema
4) If your db is...
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 9, 2007 at 12:44 am
Your trigger is assuming there's only one row inserted. If there's more than one, the not exists could return true (for 1 of the records) but on another there's a conflict.
Try...
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 9, 2007 at 12:38 am
I'm not a network expert either. You might have to do a DNS lookup from the command prompt, using xp_cmdshell, then parse the results of that.
You could try ping....
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 9, 2007 at 12:15 am
What you can try, as a last resort, is to add WITH (ROWLOCK) to the update statement. I don't normally suggest hints as SQL usually does a good enough job...
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 6, 2007 at 6:59 am
A case statement in SQL can only be used within a select/update statement. It can't be used for control flow in the procedure. For the latter, use IF statements.
The form...
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 6, 2007 at 3:12 am
The lock requests are on a RID. That's not possible if there's a clustered index on the table in question. RIDs (Row Identifiers) only exist in heaps.
Can you post 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 6, 2007 at 3:02 am
See if you can get traceflag 1204 switched on. That outputs the details of the deadlock to the error log, including both nodes and what resource they were deadlocked on.
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 6, 2007 at 2:48 am
SELECT @@Servername and SELECT serverproperty('MachineName') will get you what SQL thinks the machine name is. Typically, this is the name the machine had when it was installed, though it can be...
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 6, 2007 at 2:09 am
Ah, so it's an auto-generated query.
A transaction is not considered one statement, and you're right, the CTE would be gone by the second select. Since this is auto generated, try...
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 5, 2007 at 3:15 am
Perhaps insert the subquery portion into a temp table (or use a CTE), then you can use that in the outer query and again to get the rowcount.
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 5, 2007 at 2:03 am
You might be able to use ROW_NUMBER().
In your subquery, include another field ROW_NUMBER() OVER (Order BY ....) AS RowNo and give it any of the fields. Then if you can get...
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 5, 2007 at 1:05 am
I used the following book as partial prep for the 70-441 exam (Database solutions design) and I would highly recomend that others do NOT do the same.
The book is...
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 4, 2007 at 2:50 am
look up sp_executesql
declare
@stuff int , @sql nvarchar(1000)
EXEC
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
We stand on the bridge and no one may pass
July 4, 2007 at 1:06 am
You could schedule it as a OS task in sql agent. Other than that, I don't think there's a way to run an OS command without xp_cmdshell (unless you create...
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 3, 2007 at 1:28 am
Viewing 15 posts - 48,571 through 48,585 (of 49,552 total)