2013年5月24日 星期五
[Jquery]攔截BACKSPACE回上頁的事件
$(function () {
var rx = /INPUT|TEXTAREA/i;
var rxT = /RADIO|CHECKBOX|SUBMIT/i;
$(document).bind("keydown keypress", function (e) {
var preventKeyPress;
if (e.keyCode == 8) {
var d = e.srcElement || e.target;
if (rx.test(e.target.tagName)) {
var preventPressBasedOnType = false;
if (d.attributes["type"]) {
preventPressBasedOnType = rxT.test(d.attributes["type"].value);
}
preventKeyPress = d.readOnly || d.disabled || preventPressBasedOnType;
} else { preventKeyPress = true; }
} else { preventKeyPress = false; }
if (preventKeyPress) { e.preventDefault(); "做你想做的事情"}
});
});
2013年5月19日 星期日
[MSSQL][SQL] Show Table MetaData
SELECT
SCHEMA_NAME(T.schema_id) AS table_schema,
T.name,
KC.name AS constraint_name,
COL_NAME(T.object_id, IC.column_id) AS column_name,
IC.key_ordinal,
IC.is_descending_key
FROM
sys.tables AS T
INNER JOIN
sys.key_constraints AS KC
ON KC.parent_object_id = T.object_id
INNER JOIN
sys.indexes AS I
ON KC.unique_index_id = I.index_id
AND KC.parent_object_id = I.object_id
INNER JOIN
sys.index_columns AS IC
ON I.object_id = IC.object_id
AND I.index_id = IC.index_id
WHERE
T.type = 'U'
AND IC.is_included_column = 0
and T.[name] = @tablesname
ORDER BY
T.object_id,
IC.key_ordinal;
2013年5月5日 星期日
訂閱:
文章 (Atom)