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 dbo.stackexchange | |
| ( | |
| site_name national character varying(100) NULL | |
| ,dump_date national character varying(50) NULL | |
| ,dump_time national character varying(5) NULL | |
| ,dump_size national character varying(50) NULL | |
| ); | |
| -- Get data from |
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
| // XML 1.1 only: | |
| var str = "Hello World äöü ÄÖÜäöüàéèâêû'áéóñ"; | |
| var output = []; | |
| for(var i = 0; i < str.length; ++i) | |
| { | |
| // http://www.w3schools.com/jsref/jsref_charCodeAt.asp | |
| output.push("&#" + str.charCodeAt(i) + ";"); | |
| } |
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
| DECLARE @pvt TABLE( VendorID int, Emp1 int, Emp2 int, Emp3 int, Emp4 int, Emp5 int); | |
| INSERT INTO @pvt VALUES (1,4,3,5,4,4); | |
| INSERT INTO @pvt VALUES (2,4,1,5,5,5); | |
| INSERT INTO @pvt VALUES (3,4,3,5,4,4); | |
| INSERT INTO @pvt VALUES (4,4,2,5,5,4); | |
| INSERT INTO @pvt VALUES (5,5,1,5,5,5); | |
| SELECT * FROM @pvt; |
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 T_SYS_Language_Forms_i18n | |
| ORDER BY LANG_i18n_LANG_UID, LANG_i18n_SYSLANG_LCID | |
| SELECT | |
| LANG_i18n_LANG_UID | |
| ,[2055] AS Lang_DE | |
| ,[4108] AS Lang_FR |
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 sys.views WHERE object_id = OBJECT_ID(N'[dbo].[V_DELDATA_Tables_All]')) | |
| DROP VIEW [dbo].[V_DELDATA_Tables_All] | |
| GO | |
| CREATE VIEW [dbo].[V_DELDATA_Tables_All] |
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 | |
| extractedRow.XmlCol.value('local-name(.)', 'nvarchar(255)') AS ColumnName | |
| ,extractedRow.XmlCol.value('.', 'nvarchar(max)') AS ColumnValue | |
| FROM | |
| ( | |
| SELECT * | |
| FROM t_map_currency_rate | |
| WHERE cur_uid = 'E620572A-6C78-4750-A9B6-BFA6D6680C05' | |
| FOR XML PATH, TYPE |
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
| DROP TABLE IF EXISTS CTE_AllTables; | |
| -- CREATE TEMPORARY TABLE IF NOT EXISTS CTE_AllTables | |
| CREATE TEMPORARY TABLE CTE_AllTables AS | |
| SELECT | |
| ist.table_schema AS OnTableSchema | |
| ,ist.table_name AS OnTableName | |
| ,tForeignKeyInformation.FkNullable | |
| -- WARNING: TableSchema or Tablename can contain entry-separator (';' used) | |
| ,CAST(DENSE_RANK() OVER (ORDER BY ist.table_schema, ist.table_name) AS varchar(20)) AS OnTableId |
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
| --DROP TABLE IF EXISTS #CTE_AllTables; | |
| IF OBJECT_ID('tempdb..#CTE_AllTables') IS NOT NULL DROP TABLE #CTE_AllTables; | |
| SELECT | |
| ist.table_schema AS OnTableSchema | |
| ,ist.table_name AS OnTableName | |
| ,tForeignKeyInformation.FkNullable | |
| -- WARNING: TableSchema or Tablename can contain entry-separator (';' used) |
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.Linq; | |
| // using System.Text; | |
| // using System.Threading.Tasks; | |
| namespace LinqTest | |
| { |
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
| ;WITH CTE AS ( | |
| SELECT 'abort' AS keyword | |
| UNION ALL SELECT 'absolute' AS keyword | |
| UNION ALL SELECT 'access' AS keyword | |
| UNION ALL SELECT 'action' AS keyword | |
| UNION ALL SELECT 'add' AS keyword | |
| UNION ALL SELECT 'admin' AS keyword | |
| UNION ALL SELECT 'after' AS keyword | |
| UNION ALL SELECT 'aggregate' AS keyword | |
| UNION ALL SELECT 'all' AS keyword |