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
ALTER TABLE [dbo].[MyTable] | |
ADD CONSTRAINT FK_MyTable_OtherTable FOREIGN KEY (OType) | |
REFERENCES [dbo].[OtherTable] (Ident) | |
ON DELETE CASCADE | |
ON UPDATE CASCADE |
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
IF exists( select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='myTable' and COLUMN_NAME='columnToDrop') | |
BEGIN | |
ALTER TABLE myTable drop COLUMN columnToDrop | |
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
private void ClearDb(IGraphClient client) | |
{ | |
client.Cypher | |
.Match("(n)") | |
.DetachDelete("n") | |
.ExecuteWithoutResults(); | |
} |
Here is an example of importing distinct data from a CSV file, and creating relationships using that data.
This method is more efficient than just using MERGE. It never tries to match any duplicates from the csv file as they are filtered out beforehand. It still uses MERGE to ensure that duplicate nodes are not created, but in this situation this would only be required if the csv file was loaded more than once.
OlderNewer