Quantcast
Channel: SQL Server Database Engine forum
Viewing all 12554 articles
Browse latest View live

Min/Max memory setting best practice

$
0
0
[Not sure if best forum for this question is Database Engine forum SQL Server Manageability forum?]  I know there are many articles on this topic, but would like your information.  A senior DBA says OK to set min/max to same value (possibly two thirds of physical memory) as long as memory requirement for OS is taken into account (thus, leaving one third of memory for OS and other apps.)  While every expert article I read offers an algorithm that sets min/max at different values.  What reasons can I use to counter his argument for setting min/max to same value?  Senior DBA says he has never encountered problems or reports of slow servers using his practice. Thanks.

ETL load process locked by a system query running a create index???

$
0
0

Hi,

I suffered a strange issue during the loading of data using SSIS into a clustered columnstore index table 

SQL 2016 Enterprise edition used.

in the middle of the loading, my insert were locked by a create index command executed by the system ????

it was not a user query or user connection.

its a random behavior I suffered it 2 times in the past 2 months.

any idea of the reason of this?

is the system doing some background tasks on the clustered columnstore index which lock it?

SQL Server Linux error: There have been misaligned log IOs which required falling back to synchronous IO. The current IO is on file .ldf.

$
0
0

We're in the process of evaluating SQL Server for Linux 2017.  We're running the latest CU.  We've tested restoring a full backup and then applying log files.  During the restore of log files we are receiving this error:

error: There have been <N> misaligned log IOs which required falling back to synchronous IO.  The current IO is on file <path>.ldf.

I've followed this blog article:

https://blogs.msdn.microsoft.com/saponsqlserver/2014/10/01/message-misaligned-log-ios-which-required-falling-back-to-synchronous-io-in-sql-server-error-log/

and verified that the current Windows server running the database has SAN disks with 512/512.   I tried enabling trace flag 1800 and restarting the SQL Server Linux instance, but as the log files apply it still generates that error.

The Linux server is running on AWS EBS volumes.  The partition was formatted with ext4 using this type of command:

mkfs -t ext4 /dev/nvme2n1

As far as I can tell I should have 512 byte sectors. Here are the outputs of some of the commands I know to check:

[root@ ~]# cat /sys/block/nvme2n1/queue/logical_block_size
512
[root@ ~]# cat /sys/block/nvme2n1/queue/hw_sector_size
512

[root@ ~]# fdisk -l /dev/nvme2n1

Disk /dev/nvme2n1: 1073.7 GB, 1073741824000 bytes, 2097152000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@ ~]# tune2fs -l /dev/nvme2n1
tune2fs 1.42.9 (28-Dec-2013)
Filesystem volume name:   <none>
Last mounted on:          /sql/log
Filesystem UUID:          5d00c2b1-ab6f-4740-a178-a60a7e4687d5
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              65536000
Block count:              262144000
Reserved block count:     13107200
Free blocks:              237685822
Free inodes:              65535987
First block:              0
Block size:               4096
Fragment size:            4096
Group descriptor size:    64
Reserved GDT blocks:      1024
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Mon Oct 15 06:22:56 2018
Last mount time:          Sat Oct 20 10:49:32 2018
Last write time:          Sat Oct 20 10:49:32 2018
Mount count:              10
Maximum mount count:      -1
Last checked:             Mon Oct 15 06:22:56 2018
Check interval:           0 (<none>)
Lifetime writes:          172 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      85c2a066-e296-42f3-8ad0-278cbaa2564e
Journal backup:           inode blocks

The one things I'm wondering about is the 4096 output that the tune2fs is producing. Does anyone have recommendation on how to resolve this?

Thanks,

Jonathan

Update 1

I tried formatting the log volume with the command:

mkfs.xfs -m crc=0 -b size=512 -f /dev/nvme1n1

I thought it I could force 512 block size it might match whatever Windows was and get rid of the misalignment warnings. Didn't seem to help.

I did recover the database to and run an index maintenance task which generates a good amount of I/O and it seemed to run fine and no errors were generated. I'm just wondering if these alignment errors will be a temporary and harmless error during the migration from Windows to Linux. Just want to make sure that we have the correct and optimal configuration going forward.

calculated columns with convert in indexed views

$
0
0

Hi,

I have a report where I need to get some aggregations and grouped by columns with imprecise types.

As you can not use imprecise columns in indexed views I tried to add precise computed columns in my source tables and use them instead. I cannot do it. I get "A severe error occurred on the current command.  The results, if any, should be discarded.". Below I attached my sample code.

Is there some explanation behind it? Are computed columns with type casts considered as dependencies or something?

CREATE TABLE [dbo].[TopCase](
	[Id] [uniqueidentifier] NOT NULL primary key,
	[IdentityID] [bigint] IDENTITY(1,1) NOT NULL,
	[Deductible_CurrentValue] [float] NULL,
	[Deductible_CurrentValue_numeric]  AS (CONVERT([numeric](18,5),[Deductible_CurrentValue])) PERSISTED,
)
GO

CREATE TABLE [dbo].[TopService](
	[Id] [uniqueidentifier] NOT NULL primary key,
	[IdentityID] [bigint] IDENTITY(1,1) NOT NULL,
	[CaseId] [uniqueidentifier] NULL,
)
GO

create view dbo.testView1
with schemabinding
 as
	SELECT 
		 c.[IdentityID]
		 ,c.[Deductible_CurrentValue_numeric]
	FROM [dbo].[TopCase] c
	inner join [dbo].[TopService] cs on cs.caseid=c.id
GROUP BY 
	c.[IdentityID]
	,c.[Deductible_CurrentValue_numeric]
	
go

CREATE UNIQUE CLUSTERED INDEX [iiiiiiiiiiiiiiiiiii] ON [dbo].[testView1](
	[IdentityID] ASC
)
go


Best,

Rafael


Rafal


Link Server problem

$
0
0

I am having some problem on linkedserver  version SQL 2016

I have two sql instances on windows 2 nodes cluster. 

 when both instance sitting on the same server. link server and distribute transaction work perfects.

but once I move one of it to another server , it doesn't work and through the following error.

I am using "Be make using login's current security context " in security of link server setting:


Restoring a database to a point in time to different name, it is possible?

$
0
0

Hello guys,

I've a SQL server 2016 and one database with transaction log set FULL, backups (data and log) occurs every night, I would like to explain this example for purpose:

During working day one user delete by mistake one or more rows, I have to restore these records from transaction log but I cannot restore entire db to a point in time because meanwhile other usershave continued to work.

So my aim is restore database to a point in time (before user has deleted the rows) to different database name, then I can recover rows doing an insert into select ..

I have simulated this situation and I tried to restore database to a different name but it get me an error:

"exclusive access could not be obtained because the database is in use"

Someone can help me and explain how I can do to recover these rows?

thanks!

Andrew



SQL Server Alert System: 'Severity 016' occurred on \\SQLSERVER1

$
0
0

Good Day Everyone,

I keep getting this error on my SQL Server on average by the hour. This is a SQL2014 server with the latest sp (virtual).

DESCRIPTION:   TCP connection closed but a child process of SQL Server may be holding a duplicate of the connection's socket. Consider enabling the TcpAbortiveClose SQL Server registry setting and restarting SQL Server. If the problem persists, contact Technical Support.

I verified no antivirus is causing the issue. I verified CPU, memory everything in tact. Server is behaving normal for clients except our middle tier agent and web servers disconnect every once in a while but it does not align with every instance this error occurs. Any assistance or words of wisdom would be appreciated.

Have a pleasant day.

Best,

Frank


A SQL Server MVP or MSFT Eng should be replying soon as well. Hope this helps. Frank Garcia *** Please select "Vote As Helpful" if the information provided was helpful to you. If an answer to your issue solved the problem then please mark it as"Propose As Answer" located at the bottom. Thank you. ***

MSBUILD and automated releases

$
0
0

All,

I'm posting this question here even though it is more of a AzureDevOps question but nevertheless it is related to SQLServer and I could not find an exclusive forum for AzureDevOps.

We have to implement CI/CD for our SQLServer 2012 database releases. We used to use TFS but now we have migrated to VSTS platform and now we are working on the Database CI/CD design. We decided that we will be using the State-Based approach using the SQLPackage to deploy the differential scripts from the project and in this Phase I of our project, we are not considering Unit Testing.

We have identified two tools primarily to use in our pipeline ie, SQLPackage and MSBuild. We will use SQLPackage to build the Test Bed for the database against which we will be targeting the planned changes and we will be using MSBuild to create off of the database solution/Project that the developers would check in. We will eventually deploy the changes using SQLPackage as it can apply the differences against the target environment (Test Build, Stage and Prod).

In the Publish phase of the SQLPackage, we will put in lot of restrictions such as

[1] Ignore Logins

[2] Ignore Users

[3] Ignore Database creation

I just wanted to hear from others their experiences and lessons learnt.. Let me know if I'm missing anything.

Thanks,

rgn



SQL Cluster: initerrlog: Could not open error log file - 'MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG' OS system Error 3 on

$
0
0

Hi

I have a SQL Cluster with two nodes using SQL 2016 Std.

On the inactive node I get lots of errors saying "initerrlog: Could not open error log file 'D:\SQL\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 3(The system cannot find the path specified.)."

I get about 10 per minute. Since the node I'm getting this on is inactive and therefore none of the SQL Services are running I'm bit confused as to why I get the error at all.

I should say that the SQL Cluster uses Shared Disks (not CSVs).

Any help would be appreciated

Rich

QueryStore grows and grows

$
0
0

Hi guys,

I have a database with QS enabled with the follow settings;
-2016SP1CU7 standard edition
-operation mode RW
-data flush interval 15 min
-statistics collection interval 1 day
-max size 200 MB
-querystore capture mode auto
-size based cleanup mode auto
-stale query threshold 30 days

The size of the database is around 790 GB.

Thé query store used is 11GB !!!!
I wonder why this is happening. Can somebody tell me what is possibly wrong? Can I purge query data without any problems or set it to read-only? Is this probably a bug? Has anybody seen this before? And if so what is/was the solution?

kind regards
Marco

SQL temp DB suddenly growing and reserving all the available space in the disk

$
0
0

Dear Experts,

I'm facing the issues in temp DB. which is growing suddenly and reserving all the available space in disk.

This I'm facing once in a week. In this case Shrink also  not working and there is no blocked transactions as well in temp DB.

To release the occupied space I must restart the SQL services. 

I have tried to run a SQL profiler but i couldn't  found the exact reason.

There are three major applications connected to the database AX, CRM and SP.

please advice if anyone experienced and resolved the same issue. 

Thanks & Regards,


SQL Server 2017 licence

$
0
0

Hi Team,

we planning to keep primary secondary <g class="gr_ gr_57 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="57" id="57">db</g> copy in primary data <g class="gr_ gr_113 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="113" id="113">center</g>..and planning to keep one more DR copy in <g class="gr_ gr_205 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="205" id="205">secondary</g> data <g class="gr_ gr_210 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="210" id="210">center</g>. Please suggest ..DR copy also consider as core <g class="gr_ gr_424 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" data-gr-id="424" id="424">basedlicense</g> ??

Thanks

Kural

Merge on temporal table fails with Attempting to set a non-NULL-able column's value to NULL

$
0
0

Workflow:

  1. Create temporal table with default history table in a data warehouse
  2. Create an index on the history table
  3. Perform merge statements against the temporal table on an hourly basis
  4. Notice sometimes the error will produce: Attempting to set a non-NULL-able column's value to NULL
  5. Drop the index from the history table
  6. Perform the merge with the same data set, and it will be successful
  7. Recreate the index on the history table
  8. Randomly the error will generate again, repeat steps 5 thru 7

On April 29th I created a new temporal table named [dbo].[FactPersonnelScheduleDetails_Current] with a default history table named [History].[FactPersonnelScheduleDetails_Current].

This table is in a data warehouse that performs several merge statements on an hourly basis.

Twice now since implementing this table 4 days ago, the merge transaction has failed with the following error: "Attempting to set a non-NULL-able column's value to NULL"

The History table has one user-defined index. As soon as I drop that index, I can the successfully complete the merge.

Any suggestions why the MERGE is failing when I have a user defined index created on the history table, but works when I remove the user defined index?

CREATE TABLE [dbo].[FactPersonnelScheduleDetails_Current] ( 
[ScheduleCellKey]                    INT                NOT NULL,
[ScheduleCellID]                     INT                NOT NULL,
[DBID]                               SMALLINT           NOT NULL,
[ScheduleDetailsID]                  INT                NOT NULL,
[RecordNumber]                       SMALLINT               NULL,
[WorkDate]                           DATE                   NULL,
[WorkDateKey]                        INT                    NULL,
[WeekStartDate]                      DATE                   NULL,
[DayOfTheWeek]                       VARCHAR(50)            NULL,
[WorkDayNumber]                      TINYINT                NULL,
[MasterScheduleCellKey]              INT                    NULL,
[WorkingScheduleMatchesMasterScheduleFlag] VARCHAR(3)       NULL,
[DateWorkingScheduleNoLongerMatchesMaster] DATETIME2(7)     NULL,
[IsHoliday]                          VARCHAR(3)             NULL,
[JobPostDetailID]                    INT                    NULL,
[JobPostDetailKey]                   INT                    NULL,
[JobNumber]                          VARCHAR(10)        NOT NULL,
[JobKey]                             INT                NOT NULL,
[JobTierKey]                         INT                NOT NULL,
[EmployeeNumber]                     INT                    NULL,
[EmployeeKey]                        INT                    NULL,
[CategoriesDetailID]                 INT                    NULL,
[BillCategory]                       VARCHAR(50)            NULL,
[HoursTypeID]                        SMALLINT               NULL,
[HoursTypeDescription]               VARCHAR(50)            NULL,
[PaycheckDescriptionId]              SMALLINT               NULL,
[PaycheckDescription]                VARCHAR(50)            NULL,
[RecordTypeID]                       TINYINT                NULL,
[Hours]                              DECIMAL(19,4)          NULL,
[InTime]                             TIME(3)                NULL,
[InTimeString]                       VARCHAR(8)             NULL,
[InDateTime]                         DATETIME               NULL,
[OutTime]                            TIME(3)                NULL,
[OutTimeString]                      VARCHAR(8)             NULL,
[OutDateTime]                        DATETIME               NULL,
[LunchHours]                         DECIMAL(19,4)          NULL,
[NextDay]                            VARCHAR(3)         NOT NULL,
[PayRate]                            MONEY                  NULL,
[SpecialPayRate]                     VARCHAR(3)         NOT NULL,
[ForceOTToThisJob]                   VARCHAR(3)         NOT NULL,
[OvertimeHours]                      DECIMAL(19,4)          NULL,
[DoubletimeHours]                    DECIMAL(19,4)          NULL,
[InvoiceNumber]                      INT                    NULL,
[InvoiceDescription]                 VARCHAR(100)           NULL,
[TierDescription]                    VARCHAR(100)           NULL,
[BillRate]                           MONEY                  NULL,
[SpecialBillRate]                    VARCHAR(3)         NOT NULL,
[BillingPayRate]                     MONEY                  NULL,
[NonBillableTypeID]                  SMALLINT               NULL,
[NonBillableTypeDescription]         VARCHAR(50)            NULL,
[LastChangedBy]                      VARCHAR(20)            NULL,
[LastChangedDate]                    DATETIME               NULL,
[DaysBetweenWorkDateAndModifiedDate] INT                    NULL,
[UpdatedToTKHours]                   VARCHAR(3)             NULL,
[SpecialInvoiceDescription]          VARCHAR(3)             NULL,
[SpecialTierDescription]             VARCHAR(3)             NULL,
[InvoiceDetailID]                    INT                    NULL,
[TTMStatusID]                        INT                    NULL,
[IsConfirmed]                        VARCHAR(3)             NULL,
[DateConfirmed]                      DATETIME               NULL,
[IsPublished]                        VARCHAR(3)             NULL,
[AcceptedTypeForPSTT]                TINYINT                NULL,
[TeamTimeAcceptedTypeDescription]    VARCHAR(50)            NULL,
[UserName]                           VARCHAR(20)            NULL,
[DateChanged]                        datetime               NULL,
[Notes]                              VARCHAR(255)           NULL,
[SystemNotes]                        VARCHAR(8000)          NULL,
[ETLDateChanged]                     DATETIME2(7)       NOT NULL DEFAULT (sysdatetime()),
[RecordInsertTimestamp]              DATETIME2(7)       NOT NULL DEFAULT (sysdatetime()),
[RecordUpdateTimestamp]              DATETIME2(7)       NOT NULL DEFAULT (sysdatetime()),
SysStartTime datetime2(0) GENERATED ALWAYS AS ROW START CONSTRAINT DF_SysStart DEFAULT SYSUTCDATETIME(),
SysEndTime datetime2(0) GENERATED ALWAYS AS ROW END CONSTRAINT DF_SysEnd DEFAULT CONVERT(datetime2 (0), '9999-12-31 23:59:59'),
PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime),
CONSTRAINT PK_FactPersonnelScheduleDetails_Current PRIMARY KEY NONCLUSTERED (ScheduleCellKey))
WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = History.FactPersonnelScheduleDetails_Current));

CREATE CLUSTERED INDEX [IX01_FactPersonnelScheduleDetails_Current]
ON [dbo].[FactPersonnelScheduleDetails_Current] (WorkDateKey,DBID);

CREATE NONCLUSTERED INDEX [IX02_FactPersonnelScheduleDetails_Current]
ON [dbo].[FactPersonnelScheduleDetails_Current] (JobKey)
INCLUDE (ScheduleCellKey,DBID,WeekStartDate,JobTierKey,EmployeeKey,Hours,WorkingScheduleMatchesMasterScheduleFlag);

CREATE NONCLUSTERED INDEX [IX03_FactPersonnelScheduleDetails_Current]
ON [dbo].[FactPersonnelScheduleDetails_Current] (RecordUpdateTimestamp,MasterScheduleCellKey)
INCLUDE (ScheduleCellKey,WeekStartDate,DayOfTheWeek,JobPostDetailKey,JobKey,EmployeeKey,CategoriesDetailID,Hours,InTime,OutTime,NextDay,PayRate,SpecialPayRate,ForceOTToThisJob,BillRate,SpecialBillRate,NonBillableTypeID,ETLDateChanged,RecordNumber,WorkingScheduleMatchesMasterScheduleFlag);

CREATE NONCLUSTERED INDEX [IX04_FactPersonnelScheduleDetails_Current]
ON [dbo].[FactPersonnelScheduleDetails_Current] (WorkingScheduleMatchesMasterScheduleFlag)
INCLUDE (ScheduleCellKey,DBID,WeekStartDate,JobKey,JobTierKey,EmployeeKey,DateWorkingScheduleNoLongerMatchesMaster);

CREATE NONCLUSTERED INDEX [IX01_FactPersonnelScheduleDetails_Current]
ON [History].[FactPersonnelScheduleDetails_Current] (WorkDateKey,DBID)
INCLUDE (ScheduleCellKey,WeekStartDate,JobKey,JobTierKey,EmployeeKey,Hours,SysStartTime,SysEndTime);

Sql Server 2016 Sp2 Update issue

$
0
0

After installing SQL Server 2016 SP2 in oneof the server, sql services are failed to restart: got below error

Starting execution of PRE_MSDB.SQL
2018-10-23 13:09:15.37 spid7s      ----------------------------------
2018-10-23 13:09:15.67 spid7s      Error: 3930, Severity: 16, State: 1.
2018-10-23 13:09:15.67 spid7s      The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.
2018-10-23 13:09:15.67 spid7s      Error: 912, Severity: 21, State: 2.
2018-10-23 13:09:15.67 spid7s      Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 3930, state 1, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
2018-10-23 13:09:15.67 spid7s      Error: 3417, Severity: 21, State: 3.
2018-10-23 13:09:15.67 spid7s      Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
2018-10-23 13:09:15.67 spid7s      SQL Server shutdown has been initiated
2018-10-23 13:09:15.67 spid7s      SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
2018-10-23 13:09:16.70 spid7s      Error: 25725, Severity: 16, State: 1.
2018-10-23 13:09:16.70 spid7s      An error occurred while trying to flush all running Extended Event sessions.  Some events may be lost.

Collation SQL_Latin1_General_CP1_CI_AS vs Latin1_General_BIN2

$
0
0

Change database / column collation from SQL_Latin1_General_CP1_CI_AS vs Latin1_General_BIN2

1. what's the sorting difference?

2. what's the character size difference ?

3. what's the steps the change the collation ? for database it should be easy, for column collation , how to change at once?

4. Are there character conversion need ?will there be character corruption during the collation change/?


SQL 2014 - ALTER INDEX online default ?

$
0
0

Hello when issuing an ALTER INDEX (REBUILT OR REORG) without specifying online or offline option...is the default ONLINE ?

Thanks in advance.

Availability Group Database Backups

$
0
0

Hello Forum

We are using 2014 SQL Server Availability Groups.  One of our previous DBA's has devised a Backup Script which essentially performs Full and Differential Backups on the Primary replica, and TL backup on the Read Only replica.

Is there a way to share the backup history between the replicas, so that if we need to do a PIT restore with the GUI, all backup history is available?


Please click "Mark As Answer" if my post helped. Tony C.

Reg: How to resolve the Sleep_Task Wait Type....

$
0
0

Hi Experts,

in one of the Production server having SSIS packages in SSIS db , i have occured the following wait type as shown in picture.

can i know which causes this issue and how  can i over come this wait type in sql  server.

Thanks in Advance.

Spreading Partitions across multiple files

$
0
0

Hi

I'm working on a system which has around 370m records in a non partitioned table. Queries against this table suck.

After doing some analysis it's fairly obvious that nearly all queries on this table, are for data that is < 10 days old, we have roughly 31 months of data in the table. There are a small number of reports that can be run against this, typically looking at 6-12 months of data.

Currently all of the Data that is < 10 days old is queried by a transaction ID and reports queries always have date range params.

I'm looking to split the table into a small table with the hot data in and archive the data after 10 days as this should significantly improve the performance of all normal user based transactions.

I'm looking to create a partitioned table, with each partition containing one months data. The current thought is we'd have separate files for each years worth of data, each containing 12 partitions. This would allow older data to be stored on slower/cheaper storage.

I have created file groups to represent each year, we'll have data for.

I have added a file to the db for each file group and created a partition function along the lines of:

CREATE PARTITION FUNCTION AuditLog_PFN_P1 (datetime2)  
    AS RANGE RIGHT FOR VALUES (
'20160101',
'20160201',
'20160301',
'20160401',.....)

What i would like to achieve is putting all of 2016's data into one file, 2017's into another file etc. 

Where i'm struggling is working out how to assign all of 2016s partitions to a particular file.

Please let me know a) if this can be done and b) if there are any major issues with this approach.

Thanks and regards

Matt


TempDB File creation

$
0
0
Some one created the Temp Data file for TempDB in SQL Server 2012 , just want to know who and when its created ?
Viewing all 12554 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>