我有SQL代码,可为数据库表中的每一行添加一个默认值的新列。
我还需要它同时从另一个表中删除同一列,而且我不确定语法。
public MainPage()
{
_originalHeight = ApplicationView.GetForCurrentView().VisibleBounds.Height;
InputPane.GetForCurrentView().Showing += MainPage_Showing;
InputPane.GetForCurrentView().Hiding += MainPage_Hiding;
}
private double _originalHeight;
private void MainPage_Hiding(InputPane sender, InputPaneVisibilityEventArgs args)
{
this.Height = _originalHeight;
this.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Stretch;
}
private async void MainPage_Showing(InputPane sender, InputPaneVisibilityEventArgs args)
{
this.Height = _originalHeight - args.OccludedRect.Height;
this.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
var parentScrollViewer = FindParent<ScrollViewer>(this);
parentScrollViewer.VerticalScrollMode = ScrollMode.Disabled;
});
}
}
在<***>点,我想要添加代码,无论该表的值是什么,该代码将从表create procedure remove_a_column()
begin
IF ( *some given condition* ) = 0
THEN
ALTER TABLE static.new_table ADD COLUMN column_to_move smallint(6) DEFAULT 2, ADD FOREIGN KEY (column_to_move) REFERENCES static.other_table(pk);
<***>
END if;
end
中删除列column_to_move
。