The table in the question isn't partitioned. I assume the intended definitions are: CREATE PARTITION FUNCTION DemoPartitionFunction (datetime) AS RANGE RIGHT FOR VALUES (DATEADD(dd, DATEDIFF(dd, 0, GETUTCDATE()), -7), DATEADD(dd, DATEDIFF(dd, 0, GETUTCDATE()), -6), DATEADD(dd, DATEDIFF(dd, 0, GETUTCDATE()), -5), DATEADD(...


You should be able to get the estimated query plan in SSMS without running the query. If you do, you'll see that SQL Server is not going to be able to use partition elimination because you have a function on the partitioning column. Just like using a function on an indexed column prevents SQL Server from using the index, using a function on a partitioning ...


Sure, it is called splitting a partition. Splitting a Partition of a Range-Partitioned Table The below example (taken from the above URL) creates a table with quarterly partitions, then splits a quarter into monthly partitions: CREATE TABLE orders (prod_id NUMBER(6), cust_id NUMBER, time_id DATE, channel_id CHAR(1), promo_id ...


Ok, got an answer from a related question I raised a year ago. Although the sequence is used by 'fixId' it is owned by 'fixId3' So by running this command..... ALTER SEQUENCE POSITIONFIX_FIXID_SEQ owned by positionFix.fixId; I can then run the DROP command without any dependency issues.


I guess you want to see partitions in scripted objects. All you need to do is to go to Tools-Options-Scripting and play with checkboxes there:

Only top voted, non community-wiki answers of a minimum length are eligible