Viewing 15 posts - 3,781 through 3,795 (of 7,614 total)
I'll give it a guess. Typically now you use OUTER APPLY to do the type of lookup you're trying to do. You also definitely don't need to join the table...
July 21, 2017 at 7:14 am
Add a clustering index to pre-sort at least a few of the values. Just based off the very limited data you gave, I'd suggest something like this:
CREATE CLUSTERED...
July 19, 2017 at 1:56 pm
July 19, 2017 at 8:31 am
July 19, 2017 at 8:01 am
The first required step in getting reasonably decent table designs is to get rid of the myth that every table has to have an identity column and, far worse, should...
July 18, 2017 at 11:12 am
Table variables are almost always much slower than temp tables. I wouldn't use table variables unless I knew it was only 1 or 2 rows, ever, period, or I had...
July 14, 2017 at 11:43 am
If he is actually doing a SELECT ... INTO #temp, that could cause blocking, perhaps long blocking, but it normally wouldn't cause true "deadlocks". Is it an actual deadlock or...
July 14, 2017 at 9:26 am
That's a system-generated constraint name for an implicit DEFAULT constraint, such as:
USE tempdb;
CREATE TABLE table1 ( column1 int DEFAULT 0 );
EXEC sp_help 'table1';
DROP TABLE table1;
July 13, 2017 at 8:54 am
If you want to apply a table-valued function to a string from a table, you need to use APPLY, typically CROSS APPLY. Something like this:
SELECT *...
July 6, 2017 at 9:55 am
For that one query, try putting the variables into a (keyed) temp table (not a table variable), then joining to that table.:
CREATE TABLE #ids ( id...
July 5, 2017 at 11:46 am
There's an off chance the slowness has to do with log space, particularly if not in tempdb.
How much total space is the new table? If it's large, make...
July 5, 2017 at 11:41 am
In the real world, I've seen the method (1) style used quite a bit. Yes, it does violate 1NF, but it's pragmatic for the task at hand. Bottle size would...
July 3, 2017 at 11:23 am
Most typically in SQL Server I see this technique used:
SELECT TOP ...
FROM dbo.table_name
ORDER BY NEWID()
I presume that gives a roughly random sample. Of course...
June 29, 2017 at 9:57 am
June 27, 2017 at 12:02 pm
Most of the world uses ISO 5218 (0 = unknown, 1 = male, 2 = female, 9 = lawful person)
I've never seen that, and I've been in...
June 22, 2017 at 2:11 pm
Viewing 15 posts - 3,781 through 3,795 (of 7,614 total)