Viewing 15 posts - 46 through 60 (of 7,191 total)
Steve
Indeed, without an ORDER BY clause, you don't know which rows are going to be deleted. Your code also had no ORDER BY; I wrote mine to be equivalent to...
May 22, 2020 at 3:11 pm
Are you running the loop within a transaction? Have you tried substituting your DELETE statement with mine?
John
May 22, 2020 at 2:55 pm
I don't think you can assign permissions directly on the hidden mssqlsystemresource database. You'll need to assign a server-level permission to the user - possibly something like VIEW SERVER STATE.
John
May 22, 2020 at 10:20 am
Assuming <identityfield> has a primary key or unique constraint on it, I think this will do the same:
DELETE TOP (100)
FROM table;
On the wider question of parallelism, how...
May 22, 2020 at 9:11 am
Right, so are you saying you inserted millions of rows, but now none of them are there? If that's the case, then everything is working properly - zero rows are...
May 15, 2020 at 11:36 am
"ALTER TABLE REBUILD" did a thing like "truncate table"
How do you know that's what happened? Are there now no rows in your table? What happens if you run SELECT...
May 15, 2020 at 11:01 am
Did you run it in the context of the database the table is in both times? What happens if you try a DETAILED scan instead of SAMPLED? Please post table...
May 15, 2020 at 10:41 am
What parameters did you supply to dm_db_index_physical_stats? Please will you post the result set? Please will you post the DDL for the table and any indexes on it?
John
May 15, 2020 at 9:56 am
The rows column in the legacy view sysindexes isn't accurate. For a more up-to-date, although not documentedly reliable, count, use the rows column in sys.partitions instead.
John
May 15, 2020 at 9:38 am
Try partitioning on backup_set_id.
John
May 14, 2020 at 7:23 am
Sometimes people are more willing to help if they can see you've made the effort to help yourself. Why not create another database with the same sort of setup, and...
May 13, 2020 at 4:00 pm
From the documentation (emphasis mine):
Returns the sum of all the values, or only the DISTINCT values, in the expression. SUM can be used with numeric columns only. Null values...
May 13, 2020 at 10:52 am
No, because your WHERE clause only filters out a certain type of registration. What the question asks is to filter out a certain type of student. I think you need...
May 13, 2020 at 10:27 am
And giving you the correct answer wouldn't help, either. It wouldn't be right for me to do your homework for you. If you don't have the sample data, then how...
May 13, 2020 at 9:49 am
I think the easiest way to find out is to actually try it.
John
May 13, 2020 at 9:12 am
Viewing 15 posts - 46 through 60 (of 7,191 total)