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
using System; | |
using System.Collections.Generic; | |
using System.Data.SqlTypes; | |
using System.IO; | |
using Microsoft.SqlServer.Server; | |
[Serializable] | |
[SqlUserDefinedAggregate(Format.UserDefined, //Type implements IBinarySerialize | |
IsInvariantToDuplicates = false, //passing the same row will affect the result | |
IsInvariantToNulls = false, // passing NULL value will affect the result |
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
USE DatabaseWithPolishCollation | |
GO | |
IF OBJECT_ID('TestCollaction','U') IS NOT NULL | |
DROP TABLE TestCollaction | |
CREATE TABLE TestCollaction | |
( | |
Id Int PRIMARY KEY, | |
Name VARCHAR(20) NOT NULL, |
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 TABLE #TestCollaction2 | |
( | |
Id Int PRIMARY KEY , | |
Name VARCHAR(20) COLLATE Polish_CI_AS NOT NULL , | |
NameUnicode NVARCHAR(20) COLLATE Polish_CI_AS NOT NULL | |
) |
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
SELECT * | |
FROM TestCollaction tc | |
INNER JOIN #TestCollaction2 tc2 | |
ON tc.NameUnicode = tc2.NameUnicode |
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
USE DatabaseWithPolishCollation | |
GO | |
IF OBJECT_ID('TestCollaction','U') IS NOT NULL | |
DROP TABLE TestCollaction | |
CREATE TABLE TestCollaction | |
( | |
Id Int PRIMARY KEY, | |
Name VARCHAR(20) NOT NULL, |
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
GO | |
IF NOT EXISTS(SELECT * FROM sys.databases | |
WHERE name = 'DatabaseWithPolishCollation') | |
BEGIN | |
CREATE DATABASE DatabaseWithPolishCollation COLLATE Polish_CI_AS | |
END | |
GO | |
SELECT SERVERPROPERTY('Collation') | |
--Resturns on my server: Latin1_General_CI_AS_KS_WS | |
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
IAsyncResult result = _client.BeginGetLocation("Warsaw,Poland",null, null); | |
//Do some work here | |
// Wait until the operation completes. | |
result.AsyncWaitHandle.WaitOne(); | |
List<Location> locations = _client.EndGetLocation(result); |
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 OBJECT_ID('tempdb..#NumbersArray') IS NOT NULL | |
DROP TABLE #NumbersArray | |
GO | |
--Create T-SQL version of number array look-like | |
CREATE TABLE #NumbersArray | |
( | |
ArrayIndex Int PRIMARY KEY CLUSTERED, | |
Value Int | |
) | |
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
INSERT INTO dbo.Employee(FullName, City, Country, Email) | |
VALUES('Maksymilian Mulawa', | |
'Warsaw', | |
'Poland', | |
'[email protected]') |
NewerOlder