Quantcast
Channel: Forumul SQL Server Database Engine
Viewing all 15780 articles
Browse latest View live

SQL Server 2014 Std , Without execting all lines in the Procedure getting exit some times .

$
0
0

 HI,

We are using MS SQL server 2014 Std. on Win 2012 Std. Srvr .... <o:p></o:p>

Sometimes procedures are not getting executed thoroughly and getting exit in between without raising any errors. We used Begin Trans, rollback and try,catches... Surprisingly nothing works and later some time it works as normal.

but same solution is working in other servers whose OS is Win 2012 R2 and SQL Server 2014 Std. only differance is R2?

does it have this much impact?

thanks and regards,

SIG_SQL


Why is Number of Connections always 1?

$
0
0

I have a web site that queries every 10 seconds for data via a restful call.  Because I am logging after anywhere from 20 to 80  minutes  I see this error/exception raisedTimeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.   The code from C# has  using block and in theory all connections are closed up on exit.  I added immediately after my data query a2nd query  to return how many connections ... The VERY last time before the query hangs with the error I record Cnx details 44 - AAASupport -nos\AAAvm$ Total Connections: 1    I have had a coworker log on to the server and run the query with SSMS and he just gets himself and one connection at same time I am on SSMS running same connection query.  With the code paused ( in debug it runs as me not the virtual machine ) - so connection open - same user - myself - I also query from SSMS and get just 1 connection.   What have I misunderstood about this query ? Should be 2 !

select a.dbid,b.name, loginame, count(a.dbid) as TotalConnections
from sys.sysprocesses a
inner join sys.databases b on a.dbid = b.database_id
group by a.dbid, b.name, loginame

1.) The error is not consistent with the diagnostics - how can the pool be exhausted if only 1 is connected

2.)  The query doesnt seem to work... If my connection is still open from code I should have at least 2 connections one from the code and one from my SSMS instance under the same user.  And what of my coworker with different user id

I use Dapper ( microOrm )

  using (Conn)
            {
                try
                {

                Conn.Open();
                string theQueryName = SP_INPROGRESSTESTS;
                var r1 = Conn.Query<CurrentTest>(theQueryName, null, commandType: CommandType.StoredProcedure);
                 inProg= r1.ToList();
                    // Adhoc connections states for diagnostics
                 string theQuery = $"select a.dbid,b.name, loginame, count(a.dbid) as TotalConnections from sys.sysprocesses a inner join sys.databases b on a.dbid = b.database_id group by a.dbid, b.name, loginame";
                  lc  = Conn.Query<ConnectionDetails>(theQuery).ToList();

                  //   paused here so connection should be open still !
                }
                catch (Exception e)
                {
                    Log.Logger.Error("GetInProgressTests " + e.Message);
                   
                }
               

            }

Any ideas ??  Thanks !


andrew

Exception Type: System.OutOfMemoryException on DatabaseMail service

$
0
0

Hi,

We have a Windows Server 2016 machine in Azure running SQL Server 2016. The server sends around 80 emails a day using DatabaseMail. These are all basically text or HTML emails with no attachments. They are very small emails.

Three days ago we started getting error events in event log related to DatabaseMail. Below are the four events that get raised in order.

Error Event 1:

Database Engine Instance=xxxxxxx;Mail PID=2744;Error Message:

1) Exception Information
===================
Exception Type: System.OutOfMemoryException
Message: Array dimensions exceeded supported range.
Data: System.Collections.ListDictionaryInternal
TargetSite: Boolean TryReadPlpUnicodeChars(Char[] ByRef, Int32, Int32, System.Data.SqlClient.TdsParserStateObject, Int32 ByRef)
HelpLink: NULL
Source: System.Data
HResult: -2147024882


StackTrace Information
===================
   at System.Data.SqlClient.TdsParser.TryReadPlpUnicodeChars(Char[]& buff, Int32 offst, Int32 len, TdsParserStateObject stateObj, Int32& totalCharsRead)
   at System.Data.SqlClient.TdsParser.TryReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.TryReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj, SqlCommandColumnEncryptionSetting columnEncryptionOverride, String columnName)
   at System.Data.SqlClient.SqlDataReader.TryReadColumnInternal(Int32 i, Boolean readHeaderOnly)
   at System.Data.SqlClient.SqlDataReader.TryReadColumn(Int32 i, Boolean setTimeout, Boolean allowPartiallyReadColumn)
   at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
   at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
   at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetSendMailItem(SqlDataReader itemReader)
   at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession dbSession)
   at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(DBSession db)
   at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object obj)

Error Event 2:

Database Engine Instance=xxxxxx;Mail PID=2744;Error Message:The connection is not open.

Error Event 3:

Database Engine Instance=xxxx;Mail PID=2744;Error Message:

1) Exception Information
===================
Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
Message: The connection is not open.
Data: System.Collections.ListDictionaryInternal
TargetSite: Void ValidateConnection()
HelpLink: NULL
Source: DatabaseMailEngine
HResult: -2146232832

StackTrace Information
===================
   at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.ValidateConnection()
   at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.ValidateConnectionAndTransaction()
   at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.CommitTransaction()
   at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object obj)

Error Event 4:

Database Engine Instance=xxxxx;Mail PID=2744;Error Message:The connection is not open.

---------------------------------------------------------------

This problem started about 3 days ago. Little has changed on this server. We can still send emails, it's just creating these events. However yesterday and the day before the databasemail service stopped and i had to restart it manually. I have also never seen this happen in all my years. I have two other similar servers without this issue.

I set up a loop that sent an email every 15 minutes yesterday and tested whether the service had automatically stopped and since i have done this the mail service has continued to run even though it's generating these errors. The fact that the service stopped two days in a row is what lead me to find these events.

I have noticed that the events are raised when the DatabaseMail server cycles i.e. "DatabaseMail process is started" step occurs at the same time that the error are being geneated.

I have no idea what is going on here. I have read everything i can find, i have restarted the server, their is plenty of memory, no big emails are trying to be sent.

My next step is to turn off the looping email and see if the service stops again. I am looking for assistance on what i can check next.

Regards.

Simon.

xp_cmdshell Error code 1385

$
0
0

Trying to execute a sproc that reads a Windows directory using xp_cmdshell and getting error:
"A call to 'LogonUserW' failed with error code: '1385'."

What I've done so far:

1. Enabled the xp_cmdshell procedure 
2. Created a Windows login for a non-sysadmin user: "mydomain\CmdShell_User". This user has public access toMaster.
3. GRANT EXECUTE ON xp_cmdshell TO [mydomain\CmdShell_User]
4. Created a proxy account: CREATE CREDENTIAL ##xp_cmdshell_proxy_account## with identity = 'mydomain\CmdShell_User', secret = 'somepassword'

The sproc executes successfully under my login, but other users get the above error.

Any suggestions would be welcome. Thanx!

SQL Server version:12.0.5579.0


Darrell H Burns


Problem with XML parser memory leak

$
0
0

We're using xml parameters to send a collection of data to stored procedure.
Typical (little simplified) use case would look like:

DECLARE @Values varchar(max) = '<Root><S>1</S><S>2</S><S>3</S></Root>', @h int
DECLARE @Val TABLE(ID smallint)

EXEC    sp_xml_preparedocument @h OUTPUT, @Values
INSERT INTO @Val(ID)
SELECT DISTINCT ID FROM OpenXML(@h,'Root/S',8)  WITH (ID smallint 'text()')
EXEC sp_xml_removedocument @h

SELECT * FROM @Val

We know we have to properly "pair" sp_xml_preparedocument /sp_xml_removedocument to avoid memory leaks.
Normally, our server works for months without any problems.

(I have to use external image because your portal is giving me "Body text cannot contain images or links until we are able to verify your account." error message)    https://imgpile.com/i/I5kAUR

At some point in time we're able to observe a constant growth of xml parser memory usage.
Our system still works, but it appears as if no document is being properly "removed", so our memory
usage graph begins to steadily grow.

(I have to use external image because your portal is giving me "Body text cannot contain images or links until we are able to verify your account." error message)    https://imgpile.com/i/I5kLYg

In the graph above 1.5K represents 1500MB. The only way to stop this endless growth is to restart
SQL Server service. After that it starts working just fine.

Is there a way to reclaim back all memory (some kind of overall xml parser memory "reset") without
rebooting the whole service?
Since our stored procedures are running pretty quickly (few seconds max.) is there a way to reclaim
all memory allocated by sp_xml_preparedocument which execution moment is older then some predefined time
(that would simply deallocate all "old" memory used by "old" xml documents)?

Any help would be very useful.

We're using version: Microsoft SQL Server 2014 (SP3-CU4) (KB4500181) - 12.0.6329.1 (X64)   Jul 20 2019 21:42:29   Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )

We also had identical problem with SQL Server 2012.

INT math is slow in SQL server, but only under VMware - really weird!

$
0
0

Hi

I had noticed a really strangle thing. INT calculation is 2-3-5 times slower in SQL server running in VMware than on physical machines. From VMware side, I had eliminated all possible things: balooning, CPU overconsumption, "ready" time etc. INT CPU tests (link 'Pi' digits calculation programs) show the same performance, while SQL server math operations are MUCH slower. 

Please check the test of few results on different machines. I am DBA for >20y, but I am really puzzled.

Test is simple, no parallelism, no IO, limited memory use (L2,L3 caching is irrelevant)

Results

-- 31403 ms, one PROD VM, SQL 13.0.5337 (why is it so slow??? )
-- 9227 ms,  AWS RDS 14.0.3035.2
-- 7733 ms,  very old physical machine, 10.50.6220.0, very old
-- 13666 ms,  my really old desktop, physical, 13.0.4446.0
-- 6346 ms,   desktop of my colleague, physical, 14.1000.169

create function dbo.isPrime (@n bigint)
returns int
as
  begin
  if @n = 1 return 0
  if @n = 2 return 1
  if @n = 3 return 1
  if @n % 2 = 0 return 0
  declare @sq int
  set @sq = sqrt(@n)+1 -- check odds up to sqrt
  declare @dv int = 1
  while @dv < @sq 
    begin
	set @dv=@dv+2
	if @n % @dv = 0 return 0
	end
  return 1
  end
GO
declare @dt datetime set @dt=getdate()
select dbo.isPrime(1000000000000037)
select datediff(ms,@dt,getdate()) as ms
GO



Oracle Linked Server Issue

$
0
0
I am having a Linked Server from SQL Server 2012 to Oracle 11G. TNSPing and Test Connection to the Linked Server is working fine. But when using the Linked Server to run a stored procedure or when expanding the table options in Linked Server option in SSMS, I'm getting the following error:

OLE DB provider "OraOLEDB.Oracle" for linked server "XXX" returned message "The system cannot find message text for message number 0x80040e37 in the message file for OraOLEDB.". OLE DB provider "OraOLEDB.Oracle" for linked server "XXX" returned message "The system cannot find message text for message number 0x80040e37 in the message file for OraOLEDB.". OLE DB provider "OraOLEDB.Oracle" for linked server "XXX" returned message "The system cannot find message text for message number 0x80040e37 in the message file for OraOLEDB.".

Msg 7311, Level 16, State 2, Procedure sp_xxx, Line 45 Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "OraOLEDB.Oracle" for linked server "ABC". The provider supports the interface, but returns a failure code when it is used.

I am able to connect to the Linked Server (test connection) and can even query manually to it through OPENQUERY. I have already enabled 'Allow Inprocess' option and restarted the Server, still no help. Error persists.

It was working fine before, but after an unexpected Windows Restart few days back, the above error is coming.

Diskspd and application database design decisions

$
0
0

I am curious to learn what design decision in SQL Server database design, that one should take after you understand disk subsystem capabilities using DiskSpd.

Any pointers to share?


checkdb

$
0
0

Hello,

I have a SQL Server 2012 which is around 11TB. The checkdb takes around 80 hours. 

Can I restore the backup of this SQL Server 2012 instance on a SQL Server 2016 instance and run the checkdb, since i can use maxdop in SQL Server 2016 and the checkdb completes in very less time like 15 hours instead.?

Thanks

bilal




database performance degradation

$
0
0

On 20/11 starting from 8:00 A.M the application got "Timeout expired"  error messages.

We noticed database performance degradation.

The DB was up, accepting connections but most of the queries (on different tables) were running very slow. (e.g: 3 minutes instead of several seconds)

During this time, the CPU was less than 40%, memory was stable ~ 85%.

There were no locks, nor load on the database.

 

The problem was solved after restarting the SQL Service.

No error messages detected in the Cluster, the virtual host, SQL logs and in the server event viewer.

 

Please guide us how can we find the root cause of the problem,

how to avoid it, and what else can we check if we hit the same problem again.

 

Configuration

==========

WIndows cluster on hyper-V

 

OS Name: Microsoft Windows Server 2016 Standard

OS Version: 10.0.14393 N/A Build 14393

Each cluster server has 16 CPU, 64G Ram

SQL Server version: Microsoft SQL Server 2017 (RTM-CU11) – 14.0.3038.14


Kiran

SSL Errors Connecting SQL Server 2014 database

$
0
0

I am getting the following error randomly while connecting to the sqL server 2014 database, any suggestion on how we can overcome the error?

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server returned an incomplete response. The connection has been closed.".)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.fico.dm9.db.TestDB.test(TestDB.java:31)
at com.fico.dm9.ps.BatchProcess.run(BatchProcess.java:71)
at com.fico.dm9.ps.BatchExecutor.execute(BatchExecutor.java:113)
at com.fico.dm9.ps.BatchLauncher.main(BatchLauncher.java:35)
 Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server returned an incomplete response. The connection has been closed.".
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1352)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1533)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1042)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 6 more
 Caused by: java.io.IOException: SQL Server returned an incomplete response. The connection has been closed.
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensureSSLPayload(IOBuffer.java:607)
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readInternal(IOBuffer.java:664)
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(IOBuffer.java:656)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:851)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:839)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1483)

                              

SQL server/Report server - ( services ) NT Service\MSSQLSERVER vs Network Service

$
0
0

hi,

we have two servers ,  one run on  NT Service\MSSQLSERVER  & another one is Network Service .

can you explain this difference.

NT Service\MSSQLSERVER VS  Network Service  


Backup plan of sql server database

$
0
0

Hi,

I have few databases and i want to backup them on daily basis.

I want to make it schedule everyday at midnight 12 AM.

I am planning to take a differential backup as it takes only updated changes.

But i want first time as full backup and from the next time it only takes changes in everyday basis.

How can I setup this.Please let me know

Does differential backup first time takes full backup or not ?


Ram

How can i schedule the database backup to different location (Another Server)

$
0
0

HI Team,

 I want to take the database backup everyday but which needs to stored in another server.

How can I do that ?

Please help....!!


Ram

Create Database in Azure Blob Storage Error

$
0
0

SQL Server Version:  2019 (15.0.2070.41)

OS Version: Ubuntu: 16.04

Followed instructions to create:

- Azure Storage account

- Storage Account Container 

- Access Policy/Permissions

- Generated Shared Access Signature (SAS)

When attempting to create database receive the following error:

Msg 1802, Level 16, State 4, Line 12
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 5159, Level 24, State 5, Line 12
Operating system error (null) on file "https://<storage_account_name>.blob.core.windows.net/data/testdb_log.ldf" during MakePreviousWritesDurable.
Msg 596, Level 21, State 1, Line 11
Cannot continue the execution because the session is in the kill state.
Msg 0, Level 20, State 0, Line 11
A severe error occurred on the current command.  The results, if any, should be discarded.

I receive this error through SSMS and SQLCMD directly on the Ubuntu server.

Note:  I am able to backup my a DB to this newly created storage account successfully.


A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (

$
0
0

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

A network-related or instance-specific error occurred

$
0
0

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

How to find cpu & max mem setting on sql azure single database

$
0
0

sp_configure (managed instance only in azure), gives the info for max mem setting, I have a 'single database' in azure, how to find its max mem setting:

https://techcommunity.microsoft.com/t5/DataCAT/CPU-and-Memory-Allocation-on-Azure-SQL-Database-Managed-Instance/ba-p/305508

SELECT

process_memory_limit_mbFROMsys.dm_os_job_object;

does above give the max mem setting?

To find CPU:

SELECT

COUNT(1)ASSchedulerCount


FROM

sys.dm_os_schedulers


WHERE

status='VISIBLE ONLINE';

Are above the best ways to get cpu & max mem info on a azure single database (interested to know if there are any other ways to verify the results from above 2)

Thanks



D

Query on SQL Server 2017 Always-On

$
0
0
Hi All,

DC1: (servers are in WSFC)
DB_Server1
DB_Server2

DC2:
DB_Server3

DC1 and DC2 servers are located in different geo locations. Is it possible to configure SQL 2017 Always-On/SQL 2017 Distributed Always-On in above environmnet? 
As per my understanding, the servers should be in WSFC, but DC2 DB server is not in cluster, its standalone machine. If it's not possible to configure SQL always-On in above env, please suggest which SQL HA/DR solution i can use...

script for changing filegroup in partition schema

$
0
0

Here is the sample partition function and schema. I have included my requirement to change the file group "Need to Change FG"

After merging the partition function and deleting all the RANGE which was mapped wrong below is the partition function.

Partition_Function

CREATE PARTITION FUNCTION [pf_EventData](datetime) AS RANGE LEFT FOR VALUES (N'2012-01-01T00:00:00.000',N'2019-11-01T00:00:00.000', N'2019-12-01T00:00:00.000', N'2020-01-01T00:00:00.000', N'2029-01-01T00:00:00.000')
GO

Partition Schema

CREATE PARTITION SCHEME [ps_EventData] AS PARTITION [pf_RtEvents] TO ([BigTable_Empty], [BigTable1911], [BigTable1912], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable2008], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT], [BigTable_DEFAULT])
GO

Schema.TableIndex IDStructureIndexRowsIn-Row GBLOB GBPartition #Partition FunctionBoundary TypeBoundary PointFilegroupNeed to Change this 
dbo.BigTable1CLUSTEREDPK_BigTable2151710.0304641720100pf_EventDataLeft / UpperNULLBigTable_DEFAULTBigTable_DEFAULT
dbo.BigTable1CLUSTEREDPK_BigTable166190.002388099pf_EventDataLeft / Upper1/1/2029 0:00BigTable_DEFAULTBigTable_2029
dbo.BigTable1CLUSTEREDPK_BigTable00098pf_EventDataLeft / Upper1/1/2021 0:00BigTable_DEFAULTBigTable_2012
dbo.BigTable1CLUSTEREDPK_BigTable00097pf_EventDataLeft / Upper12/1/2020 0:00BigTable_DEFAULTBigTable_2011
dbo.BigTable1CLUSTEREDPK_BigTable00096pf_EventDataLeft / Upper11/1/2020 0:00BigTable_DEFAULTBigTable_2010
dbo.BigTable1CLUSTEREDPK_BigTable00095pf_EventDataLeft / Upper10/1/2020 0:00BigTable2008BigTable_2009
dbo.BigTable1CLUSTEREDPK_BigTable00094pf_EventDataLeft / Upper9/1/2020 0:00BigTable_DEFAULTBigTable_2008
dbo.BigTable1CLUSTEREDPK_BigTable00093pf_EventDataLeft / Upper8/1/2020 0:00BigTable_DEFAULTBigTable_2007
dbo.BigTable1CLUSTEREDPK_BigTable00092pf_EventDataLeft / Upper7/1/2020 0:00BigTable_DEFAULTBigTable_2006
dbo.BigTable1CLUSTEREDPK_BigTable00091pf_EventDataLeft / Upper6/1/2020 0:00BigTable_DEFAULTBigTable_2005
dbo.BigTable1CLUSTEREDPK_BigTable00090pf_EventDataLeft / Upper5/1/2020 0:00BigTable_DEFAULTBigTable_2004
dbo.BigTable1CLUSTEREDPK_BigTable00089pf_EventDataLeft / Upper4/1/2020 0:00BigTable_DEFAULTBigTable_2003
dbo.BigTable1CLUSTEREDPK_BigTable00088pf_EventDataLeft / Upper3/1/2020 0:00BigTable_DEFAULTBigTable_2002
dbo.BigTable1CLUSTEREDPK_BigTable00087pf_EventDataLeft / Upper2/1/2020 0:00BigTable_DEFAULTBigTable_2001
dbo.BigTable1CLUSTEREDPK_BigTable50000380.3596039086pf_EventDataLeft / Upper1/1/2020 0:00BigTable1912
dbo.BigTable1CLUSTEREDPK_BigTable20000396.7081375085pf_EventDataLeft / Upper12/1/2019 0:00BigTable1911

Here is what I am expecting

Partition_Function

CREATE PARTITION FUNCTION [pf_EventData](datetime) AS RANGE LEFT FOR VALUES (N'2012-01-01T00:00:00.000',N'2019-11-01T00:00:00.000', N'2019-12-01T00:00:00.000', N'2020-01-01T00:00:00.000', N'2020-02-01T00:00:00.000', N'2020-03-01T00:00:00.000', N'2020-04-01T00:00:00.000', N'2020-05-01T00:00:00.000', N'2020-06-01T00:00:00.000', N'2020-07-01T00:00:00.000', N'2020-08-01T00:00:00.000', N'2020-09-01T00:00:00.000', N'2020-10-01T00:00:00.000', N'2020-11-01T00:00:00.000', N'2020-12-01T00:00:00.000', N'2021-01-01T00:00:00.000', N'2029-01-01T00:00:00.000')
GO

Partition Schema

CREATE PARTITION SCHEME [ps_EventData] AS PARTITION [pf_RtEvents] TO ([BigTable1911], [BigTable1912], [BigTable2001], [BigTable2002], [BigTable2003], [BigTable2004], [BigTable2005], [BigTable2006], [BigTable2007], [BigTable2008], [BigTable2009], [BigTable2010], [BigTable2011], [BigTable2012], [BigTable_2101], [BigTable_DEFAULT])
GO

After removing the RANGE from partition how to modify the partition schema to add the range to another File group instead of BigTable_DEFAULT

Thanks a lot in advance.


Please click "Mark as Answer" if the post solves your problem - Thanks

Viewing all 15780 articles
Browse latest View live


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