$strConn="Data Source=.;Initial Catalog=AdventureWorksDW2008R2;Integrated Security=True;"
$conn=New-Object System.Data.SqlClient.SqlConnection
$conn.ConnectionString=$strConn
$conn.Open()
$comm=$conn.CreateCommand()
$comm.CommandText="SELECT TOP 1000 [FullDateAlternateKey],[WeekNumberOfYear],[MonthNumberOfYear],[CalendarYear] FROM [DimDate]"
$dr=$comm.ExecuteReader()
while ($dr.Read())
{
write-output $dr[0].ToString()
}
$conn=New-Object System.Data.SqlClient.SqlConnection
$conn.ConnectionString=$strConn
$conn.Open()
$comm=$conn.CreateCommand()
$comm.CommandText="SELECT TOP 1000 [FullDateAlternateKey],[WeekNumberOfYear],[MonthNumberOfYear],[CalendarYear] FROM [DimDate]"
$dr=$comm.ExecuteReader()
while ($dr.Read())
{
write-output $dr[0].ToString()
}