This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"valueParameterInfo":[],"slotParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"","contractName":"","contractLongDescription":"","choiceInfo":[]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"valueParameterInfo":[["Amount of Ada",{"valueParameterFormat":{"contents":[0,"₳"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount of Ada to be exchanged for dollars."}],["Amount of dollars",{"valueParameterFormat":{"contents":[2,"$"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount of dollar tokens to be exchanged for Ada."}]],"slotParameterDescriptions":[["Timeout for Ada deposit","Deadline by which Ada must be deposited."],["Timeout for dollar deposit","Deadline by which dollar tokens must be deposited (must be after the deadline for Ada deposit)."]],"roleDescriptions":[["Ada provider","The party that provides the Ada."],["Dollar provider","The party that provides the dollar tokens."]],"contractType":"S","contractShortDescription":"Atomically exchange of Ada and dollar tokens.","contractName":"Swap of Ada and dollar tokens","contractLongDescription":"Waits until one party deposits Ada and the other party deposits dollar tokens. If both parties collaborate it carries the exchange atomi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"valueParameterInfo":[],"slotParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"","contractName":"","contractLongDescription":"","choiceInfo":[]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Show partition row counts | |
SELECT $PARTITION.PartitionTable_PartitionFunc(PartitionedColumn) as Partition_Number, COUNT(1) as Row_Count | |
FROM PartionedTable | |
GROUP BY $PARTITION.order_PartitionFunc(PartitionedColumn) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create function GetPartitionQueryDate() returns date as | |
-- Provides the date that we will always query partitioned tables on. | |
-- Dates within the past 90 days should always be in the operational partition of any partitioned table. | |
begin | |
return GETDATE() - 90 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$CypressCommand = 'npx cypress run --spec ' + "'" + $('$(Build.SourcesDirectory)').Replace('\', '/') + '/AutomatedTests/Cypress/cypress/integration/ci_test.js' + "'" | |
Invoke-Expression $CypressCommand |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Helper function. Drop If Exists depends on v16. | |
drop function if exists RemoveLeadingTuple; | |
go | |
create function RemoveLeadingTuple(@s varchar(max)) returns varchar(max) as | |
-- If @s contains a leading tuple, e.g., '((xx))', remove the string with that tuple removed | |
begin | |
declare @result varchar(max) = @s; | |
declare @leftParens int = 0; | |
declare @rightParens int = 0; | |
if (LEFT(@s, 1) = '(') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------- Change database name [Sandbox] to whatever you please (or create it) ------------------------------------------ | |
---------------------------------- Change paths to files below to whatever you please. ------------------------------------------ | |
---------------------------------- Cleanup shrinkfile commands at very bottom assume file names as well. ------------------------------------------ | |
---------------------------------- Create Files/File Groups ------------------------------------------------------------------------- | |
-- We will want 2 new filegroups/files four our partitions: | |
-- PRIMARY: Partition 2; operational data | |
-- History: Partition 1; historical data | |
-- Split: Partition N; temp during split/merge of partitions. | |
ALTER DATABASE [Sandbox] ADD FILEGROUP [History] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------- Create a regular Table for Demo ------------------------------------------------------------------------ | |
-- Adapted from https://www.mssqltips.com/sqlservertip/2888/how-to-partition-an-existing-sql-server-table/ | |
--Table/Index creation. Create table as it would exist before partitioning. | |
CREATE TABLE [dbo].[TABLE1] | |
([pkcol] [int] NOT NULL, | |
[datacol] [int] NULL, | |
[partitioncol] datetime) | |
GO | |
ALTER TABLE dbo.TABLE1 ADD CONSTRAINT PK_TABLE1 PRIMARY KEY CLUSTERED (pkcol) | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ShardManagement.TrySetShardMapManager(); | |
// true in this sample means first shard (operational). | |
using (var context = new ShardContext(true)) | |
{ | |
var customer = context.Customers.FirstOrDefault(); | |
if (customer != null) | |
{ | |
Console.WriteLine($"First operational customer: {customer.CustomerId}"); | |
} |
NewerOlder