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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ECCampaign | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | |
$serverName = "localhost" | |
$databaseName = "AdventureWorks" | |
$scriptDir = "D:\テーブル" | |
if (Test-Path $scriptDir) { | |
#追記するので既にファイルがある場合は出力ファイルを削除する | |
Remove-Item "$scriptDir\*" |
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
with index_stat as ( | |
select * | |
from sys.dm_db_index_physical_stats(DB_ID(N'AdventureWorks'), NULL, NULL, NULL, NULL) | |
) | |
select | |
C.schema_id | |
,A.object_id table_id | |
,B.object_id index_id | |
,C.name schema_name | |
,A.name table_name |
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
#参考:http://technet.microsoft.com/ja-jp/sqlserver/ff730155.aspx | |
[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | |
$serverName = "localhost\SQLEXPRESS" | |
$databaseName = "AdventureWorks" | |
$scriptFile = "D:\テーブル.sql" | |
#追記するので既にファイルがある場合は出力ファイルを削除する | |
if (Test-Path $scriptFile) { |
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
# 指定されたディレクトリ配下のファイルに対して、MD5チェックサムを取得する | |
# | |
# 下記ブログを参考に作成 | |
# PowerShell でハッシュ値を計算する(http://blogs.gine.jp/taka/archives/1369) | |
param($path) | |
function GetMD5{ | |
param($fileName) | |
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
; SSH2で接続するTeraTermマクロ | |
; | |
; 1:IPアドレス(ホスト名) | |
; 2:ユーザ | |
; 3:パスワード | |
; 引数チェック | |
if paramcnt<4 then | |
messagebox "引数が不足しています"#13#10" 1:IPアドレス(ホスト名)"#13#10" 2:ユーザ"#13#10" 3:パスワード" "エラー" | |
end |
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
with l_date(salesdate) as ( | |
select convert(datetime, '2012/02/01', 111) | |
union all | |
select dateadd(d, 1, salesdate) | |
from l_date | |
where salesdate <= convert(datetime, '2012/02/28', 111) | |
) | |
select * from l_date |
NewerOlder