搜尋此網誌

顯示具有 SQL 標籤的文章。 顯示所有文章
顯示具有 SQL 標籤的文章。 顯示所有文章

2018-05-30

SQL Isolation

0 意見
資料列版本控管 SnapShot Isolation V.S Read Committed Snapshot ( 一 ) ***
資料列版本控管 SnapShot Isolation V.S Read Committed Snapshot ( 二 ) ***
測試 SQL Server 的兩種 Snapshot (快照隔離) ******
鎖定與資料列版本控制 ***
透過使用資料列版本控制,讀取作業封鎖其他交易的機會可大幅降低。

SQL Server 中的快照隔離
Database Engine 中資料列版本控制式的隔離等級 *****

簡介隔離層級
事務隔離
[SQL] 使用 交易隔離等級 鎖定資料表動作

SET TRANSACTION ISOLATION LEVEL (Transact-SQL)

Hints (Transact-SQL) - Table
You can minimize locking contention while protecting transactions from dirty reads of uncommitted data modifications by using either of the following:
The READ COMMITTED isolation level with the READ_COMMITTED_SNAPSHOT database option set ON.
The SNAPSHOT isolation level. 

如何使用快照集隔離來降低鎖定問題的發生 ***
30分钟全面解析-SQL事务+隔离级别+阻塞+死锁 ***
[SQL SERVER] 找出LOCK方法懶人包
【茶包射手日記】只涉及單一資料表的Deadlock ***
Select For Update

[SQL Server]讀取認可快照隔離(RCSI) vs 交易快照隔離(Snapshot Isolation)的查詢一致性
[SQL Server]Read Committed Snapshot Isolation(RCSI)隔離層級的效能副作用
SQL Server預設是Read Committed,Oracle則是Read Committed Snapshot Isolation(RCSI)

SQL SERVER – Difference Between Read Committed Snapshot and Snapshot Isolation Level

How long should SET READ_COMMITTED_SNAPSHOT ON take? ***
SQL Server: Enabling Read Committed Snapshot Isolation ***
enabling READ_COMMITTED_SNAPSHOT
使用 ROLLBACK IMMEDIATE 砍掉指定資料庫上的全部連線,並搭配 NORECOVERY 選項執行「結尾記錄備份(Tail-log Backups)」

2017-05-04

程式開發的相關資訊安全

0 意見
【資安周報第70期】OWASP釋出新十大資安風險,API風險是新威脅
【安全报告】OWASP Top 10 2017 rc1 中文翻译

OWASP Top 10 for .NET developers
Free eBook: OWASP Top 10 for .NET developers

OWASP Top Ten Project
資訊安全雜談:OWASP TOP 10 2013
Web Security網站安全基礎篇(二)
OWASP .NET Project

Top 10 Website Security Testing Tools

Mozilla网站安全分析工具Observatory已发布




資安服務建議書徵求說明書 (RFP,Request For Proposal) 範本下載




7 HTTP headers to secure your app for the busy web developer *****

淺談IFrame式Clickjacking攻擊與防護
如何使用 HTTP 响应头字段来提高 Web 安全性?
X-Frame-Options 回應標頭

HTTP Headers 的資安議題 (1)
Content-Security-Policy - HTTP Headers 的資安議題 (2)
HttpOnly - HTTP Headers 的資安議題 (3)
如何正確的取得使用者 IP?
談 Cookie 認證安全-以宏碁雲端售票為例




介紹好用工具:UrlScan Security Tool ( 入門級的 WAF 工具 )

A Standard for Robot Exclusion
從戰國策資訊外洩事件說明 robots.txt 定義檔與資安常識
個資保護、Google Hacking 與 robots.txt 的關係與設定技巧
Dynamically Generating Robots.txt Using ASP.NET MVC

介紹好用工具:Paros ( 網站安全性掃瞄工具 )

[食譜好菜] 常在面試出現的題目:XSS

推薦使用 Microsoft Anti-Cross Site Scripting Library V3.0
推薦使用 Microsoft Anti-Cross Site Scripting Library v3.1
ASP.NET MVC - 實作 Microsoft Anti-Cross Site Scripting (AntiXss)
[ASP.NET][jQuery] ASP.NET & jQuery 注意小細節來防止XSS攻擊
Microsoft Web Protection Library
Anti-Cross Site Scripting
Microsoft AntiXSS Library 3.1 Upgrade 4.0
Microsoft Anti-Cross Site Scripting Library V4.0
Microsoft Anti-Cross Site Scripting Library V4.2
Using AntiXss As The Default Encoder For ASP.NET
Anti-Cross Site Scripting Library V4.3

[Security]Cross-Site Scripting(XSS)的簡介與預防

How To: Prevent Cross-Site Scripting in ASP.NET

設定 Cookie 時可善用 HttpOnly 特性減低網站安全風險(XSS)

Hack-Proofing Your ASP.NET Applications

資安新聞筆記-開發網站前該知道的二三事

ASP.NET 發現重大資安弱點影響範圍涵蓋 ASP.NET 1.1 ~ 4.0
由於該物件目前的狀態,導致作業無效。
URL 編碼型式資料無效


SQL Injection的解決方案1
[Security]SQL injection的簡介與預防
注入攻击-SQL注入和代码注入
渗透攻防Web篇-SQL注入攻击初级
渗透攻防Web篇-SQL注入攻击中级 渗透攻防Web篇-SQL注入攻击高级

如何打造符合個資法規的網站系統 — 以 ASP.NET 為例

ASP.NET 零時差攻擊:POET 攻擊原理與防護措施

保護 ASP.NET 網站
Web 應用程式的基本安全性實行方式 ***
善用 ASP.NET 內建功能來擊退網路攻擊
建置安全的 ASP.NET 應用程式: 驗證、授權和安全通訊

在ASP.Net防止 SQL Injection和參數篡改
injection cheat sheet
Preventing SQL Injection Attacks

TOP 15 FREE HACKING TOOLS FOR ETHICAL HACKERS





.NET Framework 4.5
Security in the .NET Framework

如何保护 .NET 应用的安全?

【資安小百科】App 的身體健康檢查 - Android 滲透測試介紹
行動應用App基本資安規範

X-Frame-Options 回應標頭


[料理佳餚] 用 SSL For Free 產生 SSL 憑證上傳給 Azure App Service 使用

2016-08-05

SQL 程式設計參考資源3 效能相關

0 意見
SQL Server Performance Tuning Tips

執行程序邏輯和實體運算子參考
分析指令碼的效能
設計索引檢視
資料表提示 (Transact-SQL)


VITO SQL 效能調校 *****
[查詢優化]影響執行計畫的因素1-Predicates(述詞)
效能調校-使用內含資料行的索引


[SQL SERVER][Memo]善用用戶端統計資料
[SQL SERVER][Performance]排序效能問題
[SQL SERVER][Performance]善用計算的資料行

[SQL SERVER][Memo]Clustered VS NonClustered Indexes
[SQL SERVER][Performance]善用Indexed View#1簡介
[SQL SERVER][Performance]善用Indexed View#2測試
[SQL SERVER][Performance]查詢效能調校

[SQL SERVER][Memo]撰寫Stored Procedure小細節
[SQL SERVER][Performance]盡量避免使用Cursor
[SQL SERVER][TSQL]取代Cursor操作

[SQL SERVER][Performance]淺談簡單和強制參數化

[SQL SERVER][TSQL] 查詢 Store Procedure 使用情況
[SQL SERVER][TSQL]獲取各種高成本查詢語法

Rico Chen的電子書城

SQL SERVER – Missing Index, Unused Index and Duplicate Index Script
Get Index Information of tables

INDEX REBUILD跟REORGANIZE的差異
Rebuild All index In SQL Server
Reorganize all index in SQL Server

ExpressProfiler
Setting up SQL Server 2008 Express with Profiler

SQL Server Performance Tuning : Table Variable Vs Temporary Tables

請問改善SQL效能的寫法
淺談 Index Seek 和 Scan
[SQL SERVER][Performance]善用 FORCESEEK 資料表提示

如何寫出高效能 TSQL - 深入淺出 SQL Server Relational Engine (含 SQL 2014 in-memory Engine)
如何寫出高效能 TSQL - 關於索引不可不知道的事
如何寫出高效能 TSQL - 探索統計值
如何寫出高效能 TSQL - 善用提示

SQL SERVER中什么情况会导致索引查找变成索引扫描
SQL SERVER中关于OR会导致索引扫描或全表扫描的浅析

[SQL]利用 REVERSE 來解決查字尾時無法搭配索引使用的困擾

2016-08-04

TransactionScope

0 意見
EF6新增Database.BeginTransaction()
Working with Transactions (EF6 Onwards)
Entity Framework (EF) TransactionScope vs Database.BeginTransaction
Transaction Support in Entity Framework 6
What's the point of an explicit database transaction in Entity Framework 6?




使用前必需詳閱說明:
使用交易範圍實作隱含交易
根據預設,交易會在隔離等級設為 Serializable 時執行。在讀取頻繁的系統上,常常會選取使用 Serializable 以外的隔離等級。

11.TRANSACTION ISOLATION LEVEL *****
All About TransactionScope *****
What is default IsolationLevel for TransactionScope?
.NET TransactionScope and its default Transaction Isolation level issue

Transactions and Connections in Entity Framework 4.0 *****

using new TransactionScope() Considered Harmful *****

Why is System.Transactions TransactionScope default Isolationlevel Serializable

Deadlocks w/Entity Framework - how to rerun the transaction?
Quote from Ladislav Mrnka:
Default isolation level for TransactionScope is serializable which is the most restrictive level for transaction (= causes deadlock more often). You should start by using Read committed isolation level (but you must ensure that same data are not read multiple times from the database during a transaction) to reduce database locking but it will most probably doesn't solve the problem (it can reduce the frequency)


目前用法:
using (var ts = new TransactionScope(TransactionScopeOption.Required, 
     new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }))
{
     //TODO
     ts.Complete();
}




TimeOut 預設1分鐘,最大10分鐘。
All About TransactionScope *****
using new TransactionScope() Considered Harmful ***
Changing TransactionScope - Timeout at runtime
Transaction scope timeout on 10 minutes
Transactionscope timeout max is only 10 mins




Introducing System.Transactions in the .NET Framework 2.0

確保交易的新利器(TransactionScope)初體驗
KB-.NET 2.0 分散式交易新利器---TransactionScope
TransactionScope與COMMIT TRAN

.NET分散式交易程式開發FAQ
多重TransactionScope與TransactionScopeOption


Nesting Transactions with a Single SQL Server Database

[IIS] 啟用Microsoft 分散式交易協調器(MSDTC)服務




ORA-02089: COMMIT is not allowed in a subordinate session

與目前連接關聯的交易已完成,但尚未處置。必須先處置交易,才能使用連接來執行 SQL 陳述式。
The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.
設定timeout

2015-07-28

Business Intelligence

0 意見
Business Intelligence
Steps Towards Microsoft Business Intelligence (BI)

Business Intelligence Blogs

SQL Server 線上叢書
影片

SQL Server 2008 R2 教學課程
SQL Server 2012 教學課程
Adventure Works 範例資料倉儲
SQL Server Samples Readme
SQL Server Community Projects & Samples

Business Intelligence for SQL Server 2012
Business Intelligence for SQL Server 2008 R2


Microsoft SQL Server 2008:產品資訊

SQL Server Data Mining Add-ins for Office
SQL Server Feature Pack
SQL Server 2012 SP1 Feature Pack
SQL Server 2008 R2 SP2 Feature Pack
SQL Server 2008 Service Pack 3 Feature Pack
SQL Server 2008 Data Mining Add-ins for Microsoft Office 2007

MCTS Self-Paced Training Kit (Exam 70-448): Microsoft SQL Server 2008 - Business Intelligence Development and Maintenance




Learn Microsoft Business intelligence step by step – Day 1
Learn Microsoft Business intelligence step by step – Day 2
Learn Microsoft Business intelligence step by step – Day 3

R Programming Language - Introduction to R for C# Programmers




以產出為導向-SPSS,SEM,PLS-在學術論文的應用

商業智慧的未來:視覺化、雲端化、行動化




Azure 機器學習
圖解機器學習

A More Efficient Text Pattern Search Using a Trie Class in .NET

Database Dashboard

0 意見
Web-based real-time SQL Server Performance Dashboard
Real-time Oracle Database Monitoring Dashboard in ASP.NET

jChaart – Web Dashboard Framework

SQL自動編號 在SQL SERVER實作SEQUENCE

0 意見
SQL Server 2012 己新增 SEQUENCE 功能
CREATE SEQUENCE (Transact-SQL)




ORACLE的自動編號和SQL SERVER不同,
若要在SQL SERVER使用類似SEQUENCE功能,
需要自行實作,可參考:

Simulating Oracle Sequences in Microsoft SQL Server & ColdFusion
How to create a sql server sequence similar to oracle
SQL Identity (autonumber) is Incremented Even with a Transaction Rollback
rollback時,如何將identity欄位遞增值也復原

SCOPE_IDENTITY (Transact-SQL)
DBCC CHECKIDENT (Transact-SQL)

Oracle與MS SQL自動編號的比較
MS SQL與Oracle取得資料庫新增後自動編號的值

如何在新增資料到資料表時,依據特定規則產生編號

SCOPE_IDENTITY
IDENT_CURRENT
@@IDENTITY
Oracle 序列


直接取得Insert的自動編號值, 不用再下一次Select:
OUTPUT 子句 (Transact-SQL)
擷取 INSERT 陳述式的結果
Oracle 序列
Oracle PL/SQL Returning 用法
RETURNING INTO Clause

RETURNING Clause in INSERT for C# - Oracle to SQL Server Migration

2015-07-22

SQL Server Data Tool

0 意見
SSDT and Visual Studio versions

Download Latest SQL Server Data Tools
SQL Server Data Tools 下載
SQL Server Data Tools (Visual Studio 2015)
SQL Server Data Tools (Visual Studio 2013)
SQL Server Data Tools (Visual Studio 2012)
SQL Server Data Tools (Visual Studio 2010)

SQL Server Data Tools - Business Intelligence for Visual Studio 2012
SQL Server Data Tools - Business Intelligence for Visual Studio 2013



Data Developer Center - SQL Server Data Tools
SQL Server 2012 Data-Tier Application Framework (July 2013)
SQL Server Data-Tier Application Framework (July 2015)


學習園地 - SQL Server Data Tools
MSDN - SQL Server Data Tools (SSDT)
資料層應用程式

SQL Server DB 轉換成 SQL Project,解決Link Server問題

SQL Server Data Tools July Update
SQL Server Data Tools for SQL Server 2014 is available SQL Server Data Tools Now Supports SQL Server 2014
SSDT & DACFx (October 2012) Compatibility Notes

Updated SQL Server Data Tools and Data-Tier Application Framework for August 2013

SQL Server Data Tools – Business Intelligence for Visual Studio 2013 (SSDT BI)
Select “New instance” on the installation dialog if you have SQL Server x64 installed.
安裝 SQL Server Data Tools - Business Intelligence for Visual Studio 2012
安裝 Business Intelligence for Visual Studio 2012(SSDT BI),讓您可以在 Visual Studio 2012 中開發 SQL Server BI 專案

[SQL Server] SQL Server Data Tools (SSDT)
好用的 SQL Server Data Tools
SQL Server 2012:SQL Server Data Tools (SSDT) 取代 Business Intelligence Development Studio(BIDS);在 Visual Studio 2010 上加裝 SSDT

使用Visual Studio 进行SQL Server源代码管理和部署
使用 Visual Studio 2013 資料庫專案發佈資料庫

SQL Server 資料庫版本控管 ***
[Visual Studio/SQL Server] 程式都已正式上線,由測試機DB更新至正式機DB的小技巧




SqlPackage.exe
擷取資料層應用程式時,發生Error SQL71562的變通作法
C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\
SqlPackage.exe /a:extract /ssn:ServerName /sdn:DbName /su:UserName /sp:"Password" /tf:"C:\DBbackup\DbName.dacpac"




使用 SQL Server 單元測試驗證資料庫程式碼
Getting Started with SQL Server Database Unit Testing in SSDT
SQL Server Unit Testing using Visual Studio 2010 and Visual Studio 2012 Side by Side

2014-10-23

Entity Framework

0 意見
MSDN
ASP.NET Data Access - Recommended Resources
ADO.NET Entity Framework
Entity Data Model 工具
Entity Framework (EF) Documentation
EF Power Tools

Code First Migrate
Config File Settings

[料理佳餚] 使用 Entity Framework Code First 應該要知道的 TPH、TPT、TPC

ObjectContext
EntityFunctions

Entities.Configuration.AutoDetectChangesEnabled = true;
Entities.Configuration.ValidateOnSaveEnabled = true;




Data Access Hands-on Labs

Entity Framework Tutorial

Entity Framework Tutorial for Beginners
Entity Framework快速入门--索引贴
Entity Framework 快速上手 & 學習資源整理
ADO.Net Entity Framework
SQL Server 2008 Entity Data Model 和 Linq to Entities
米米貓學開發

ADO.NET Entity Framework 概觀
首次接觸 ADO.NET Entity Framework
讀寫 ADO.NET Entity Framework
由 LINQ 存取 ADO.NET 物件
整合 ADO.NET Entity Framework 到應用程式中

[C#] 取得欄位的資料標記 Data Annotation from Metadata Class

Entity Framework Sample Provider
Custom ORM - Map your entity with DataSet/DataTable/DataReader

ADO.Net Entity Framework - Entity Data Model
ADO.Net Entity Framework - 簡易資料查詢





Tips for Updating and Refactoring Your Entity Framework Code
Tips for Updating and Refactoring Your Entity Framework Code, Part 2

Building the Business Logic Layer classes with Entity Framework and Code First
Various strategies to initialize Database in Entity Framework

EF Designer Code Generation Templates
Entity Framework Repository & Unit of Work T4 Template
Using T4 templates in Entity framework





Writing SQL queries for entities
Entity Framework Automatic Detect Changes

DbSetMigrationsExtensions.AddOrUpdate
How to seed data with AddOrUpdate with a complex key in EF 4.3

Add/Attach and Entity States
MERGE-like function in Entity Framework
Update Row if it Exists Else Insert Logic with Entity Framework

Entity Framework and slow bulk INSERTs
Prefixing ID columns with the table name in Entity Framework
Executing Raw SQL Queries using Entity Framework
Working with Stored Procedures in Entity Framework - Part 1
Calling Stored Procedures from Entity Framework

Entity Framework projections to Immutable Types (IEnumerable vs IQueryable)

Implementing a WCF Service with Entity Framework (v4.5)

Performing Asynchronous Operations Using Entity Framework

Domain modeling with Entity Framework scorecard

Entity Validation and the Entity Framework – Part 1
Entity Validation and the Entity Framework – Part 2
Update: Entity Framework Generic Data Access

Social Club: Sample application using WinForms, C#.NET, ADO.NET and MS Access
SocialClub: A Sample application using C#.NET, Entity Framework 5 and LocalDb

Using the Repository Pattern with ASP.NET MVC and Entity Framework




Code first migration commands for Entity Framework
EF Code First Migrations Deployment to an Azure Cloud Service

Event Calendar with Entity Framework: Quick Guide and Sample

Seeding Entity Framework Database from CSV

Missing EF Feature Workarounds: Cascade delete orphans
Missing EF Feature Workarounds: Encapsulated collections

Avoid many-to-many mappings in ORMs

Catching Bad Data in Entity Framework




Entity Framework Refresh context?
[C#.NET][Entity Framework] 快取查詢與 DbEntityEntry.Reload
[C#.NET][Entity Framework] 幾個提升 EF 效能的方法

Entity Framework Performance and What You Can Do About It
91 FB 解說



EntityFramework.BulkInsert
EntityFramework.Extended

2014-09-05

Dapper.Net

0 意見
Dapper - a simple object mapper for .Net
Dapper Tutorials & Examples

Dapper - Third Party Library
Dapper.SimpleCRUD

[dapper] + Enterprise Library
[enterprise-library] dapper

Use Dapper.NET ORM in ASP.NET MVC

短小精悍的.NET ORM神器 -- Dapper
Dapper小技巧:以資料表保存集合物件JSON
由 Dapper 傳回 dynamic 物件取得欄位清單

Dapper +Oracle 之 DateTime 注意事項

OracleParameter 型別不符導致 ORA-03111 通訊中斷錯誤

[料理佳餚] Dapper 自定義欄位對應的三種方式

好用的微型 ORM:Dapper
[.NET]輕量又兼具效能的ORM Framework - Dapper
輕型的ORM類Dapper
给力分享新的ORM => Dapper
Dapper的一些BUG的修复和扩展
关于Dapper的一些使用和扩展的例子
A Look at Dapper.NET
Dapper.NET Tutorial
Creating a Data Repository using Dapper: 10 Years of .Net Compressed into Weeks #12
RepositoryWrapper.Dapper



Making Dapper Faster with Transactions
Bulk inserts taking longer than expected using Dapper
how perform batch operation with dapper orm?
SqlBulkCopy for Generic List (useful for Entity Framework & NHibernate)
SqlBulkCopy 類別



Can't get multi-mapping to work in Dapper
Help with Multi-Mapper to create object hierarchy
Is there an equivalent to “NotMapped” for Dapper.Net and the Dapper.Net extensions?
Manually Map column names with class properties

Data Access Extension Method

Building A Dapper Glimpse Plugin
Glimpse 1.7+ with Dapper Profiling
Getting the SQL and Parameters out of Dapper for display in Glimpse

SQL Server Dapper *** Helper class to mitigate working with Dapper against SQL Server database
POCO Generator





Evaluating ORMs for Batch Data Performance
Followup on ORMs for Batch Performance
Fetch performance of various .NET ORM / Data-access frameworks




Dapper – Micro ORM for Oracle and Microsoft .NET read Oracle cursor
OracleDynamicParameters.cs




Kuick Application & ORM Framework

PetaPoco A tiny ORM-ish thing for your POCOs