SQL TSQL删除视图(如果已存在)

IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = 'v_MyView') BEGIN
    DROP VIEW dbo.v_MyView
    PRINT 'Dropped dbo.v_MyView'
END

SQL TSQL删除表(如果已存在)

IF EXISTS (
    SELECT 1 FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_NAME = 'MyTable' AND TABLE_SCHEMA = 'dbo'
) 
BEGIN
    DROP TABLE dbo.MyTable
    PRINT 'Dropped dbo.MyTable'
END

SQL TSQL删除proc,如果它已经存在

IF EXISTS (
    SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES
    WHERE ROUTINE_NAME = 'p_MyProc' 
    AND ROUTINE_SCHEMA = 'dbo'
    AND ROUTINE_TYPE = 'PROCEDURE'
) 
BEGIN
    DROP PROCEDURE dbo.p_MyProc
    PRINT 'Dropped dbo.p_MyProc'
END

SQL TSQL删除功能(如果已存在)

IF EXISTS (
    SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES
    WHERE ROUTINE_NAME = 'fn_MyFunction' 
    AND ROUTINE_SCHEMA = 'dbo'
    AND ROUTINE_TYPE = 'FUNCTION'
) 
BEGIN
    DROP FUNCTION dbo.fn_MyFunction
    PRINT 'Dropped dbo.fn_MyFunction'
END

SQL TSQL的最后一天

DATEADD(s, -1, DATEADD(d, 1, DATEADD(d, DATEDIFF(d, 0, @date), 0)))

SQL TSQL关键字搜索

SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%keyword%'

Apache 禁用电子标签

Add the following line to your .htaccess:

FileETag none

Apache Gzip您的组件

### For Apache 1 ###

mod_gzip_on Yes 

mod_gzip_item_include mime ^application/x-javascript$ 
mod_gzip_item_include mime ^application/json$ 
mod_gzip_item_include mime ^text/.*$ 

mod_gzip_item_include file \.html$ 
mod_gzip_item_include file \.php$ 
mod_gzip_item_include file \.js$ 
mod_gzip_item_include file \.css$ 
mod_gzip_item_include file \.txt$ 
mod_gzip_item_include file \.xml$ 
mod_gzip_item_include file \.json$ 

Header append Vary Accept-Encoding

### For Apache 2 ###

AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/json
Header append Vary Accept-Encoding

PHP PHP从文本生成URL

function generate_url_from_text($strText) {
    $strText = preg_replace('/[^A-Za-z0-9-]/', ' ', $strText);
    $strText = preg_replace('/ +/', ' ', $strText);
    $strText = trim($strText);
    $strText = str_replace(' ', '-', $strText);
    $strText = preg_replace('/-+/', '-', $strText);
    $strText = strtolower($strText);
    return $strText;
}

XML XAML中的表格单元格边框

<UserControl x:Class="MultidimensionalViews.Views.ColoredBarCellView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Grid.Column="4" Grid.Row="3" Width="100" Height="100">
    <Grid>
        <Rectangle Fill="Transparent" Stroke="Black" StrokeDashCap="Square" StrokeThickness="2" />        
        <StackPanel Orientation="Vertical" Name="stackPanel" Margin="2" />       
    </Grid>
</UserControl>