This file contains 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
<TextBox x:Name="myTextBox" CaretIndex="{Binding Path=Text.Length}" /> |
This file contains 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 TableName ,ColumnName | |
FROM | |
( | |
SELECT f.name AS ForeignKey | |
,OBJECT_NAME(f.parent_object_id) AS TableName | |
,COL_NAME(fc.parent_object_id, fc.parent_column_id) AS ColumnName | |
,OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName | |
,COL_NAME(fc.referenced_object_id, fc.referenced_column_id) AS ReferenceColumnName | |
FROM sys.foreign_keys AS f | |
INNER JOIN sys.foreign_key_columns AS fc |
This file contains 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
--Check if exist foreing keys for determinated table | |
IF EXISTS(SELECT C.name | |
FROM { OKW.SYS.foreign_keys | OKW.SYS.default_constraints} C | |
INNER JOIN OKW.SYS.tables T ON C.parent_object_id = T.object_id | |
INNER JOIN OKW.SYS.schemas S ON T.schema_id = S.schema_id | |
WHERE T.name = 'MyTable') | |
BEGIN | |
DECLARE @CADENA NVARCHAR(MAX) | |
SET @CADENA = '' |
This file contains 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 | |
DISTINCT | |
TIPO.name | |
, TABLA.name | |
, COL.name | |
FROM OKW.SYS.columns COL | |
INNER JOIN OKW.SYS.tables TABLA ON COL.object_id = TABLA.object_id | |
INNER JOIN OKW.SYS.types TIPO ON COL.system_type_id = TIPO.system_type_id | |
WHERE | |
TIPO.name NOT IN ('sysname') |
This file contains 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
void Main() | |
{ | |
//This method will be too slow to work with | |
ObtainDataWrong<MyEntity>(k => k.MyProperty == value); | |
//Excellent performance | |
ObtainDataRight<MyEntity>(k => k.MyProperty == value); | |
} | |
private void ObtainDataWrong<T>(Func<T, bool> selector) where T : class |