Thanks
Bradley
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Server s = new Server(@.".\SQLExpress");
s.ConnectionContext.LoginSecure = true;
s.ConnectionContext.Connect();
s.ConnectionContext.SqlExecutionModes = SqlExecutionModes.CaptureSql;
Table t = s.Databases["DBToolsA"].Tables[0];
Column c = new Column(t, "Giddy", DataType.Bit);
t.Columns.Add(c);
t.Alter();
foreach (string str in s.ConnectionContext.CapturedSql.Text)
{
Console.WriteLine(s);
}
Console.ReadLine();
}
}
}
foreach(string str in s.ConnectionContext.CapturedSql.Text)
{
Console.WriteLine(s);
To:
foreach(string str in s.ConnectionContext.CapturedSql.Text)
{
Console.WriteLine(str);
Guess that's what happens when you look at the same problem for to long.
Bradley
No comments:
Post a Comment