SQL scripts
- Add a column with default current date time
ALTER TABLE [TableName]
ADD CreatedOn DATETIME NOT NULL DEFAULT(GETDATE()); - How to Quickly Create a Copy of a Table using Transact-SQL
The easiest way to create a copy of a table is to use a Transact-SQL command. Use SELECT INTO to extract all the rows from an existing table into the new table. The new table must not exist already. The following example will copy the Customers table under the Sales schema to a new table calledCurrCustomers under the BizDev schema:
SELECT * INTO BizDev.CurrCustomers FROM Sales.CustomersYou can also create the new table from a specific subset of columns in the original table. In this case, you specify the names of the columns to copy after the SELECT keyword. Any columns not specified are excluded from the new table. The following example copies specific columns to a new table:
SELECT CustName, Address, Telephone, Email INTO BizDev.CurrCustomers
FROM Sales.Customers - Rename database
ALTER DATABASE [CurrentDatabaseName]
Modify Name = [NewDatabaseName]
SQL scripts的更多相关文章
- [MSSQL] Useful SQL Scripts - CalendarBase
Useful SQL scripts DECLARE @StartDate DATETIME DECLARE @EndDate DATETIME DECLARE @FiscalBeginMonth I ...
- General Ledger Useful SQL Scripts – Oracle Applications 11i
General Ledger Useful SQL Scripts – Oracle Applications 11i Contents GL Set of Books Configuration O ...
- General Ledger Useful SQL Scripts
General Ledger Useful SQL Scripts – Oracle Applications 11i Contents GL Set of Books Configuration O ...
- 读书笔记--SQL必知必会--建立练习环境
书目信息 中文名:<SQL必知必会(第4版)> 英文名:<Sams Teach Yourself SQL in 10 Minutes - Fourth Edition> MyS ...
- 初试WIX加SQL LocalDB
最近有个项目需要生成一个自动打包安装App和数据库的MSI文件,经同事推荐WIX,于是乎就试了一试.遇到了一些问题觉得有分享的价值,所以写篇博客记录一下 :) 使用感觉: WIX特点:功能很强大,用X ...
- [转]Dynamic SQL & Stored Procedure Usage in T-SQL
转自:http://www.sqlusa.com/bestpractices/training/scripts/dynamicsql/ Dynamic SQL & Stored Procedu ...
- Security Configuration and Auditing Scripts for Oracle E-Business Suite (文档 ID 2069190.1)
This document provides the security configuration and auditing scripts for Oracle E-Business Suite. ...
- P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1
P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1 May ...
- Database SQL script automation management tools investigation
Recently researched about database SQL scripts auto management tools, recorded the results here. Res ...
随机推荐
- Android 解压缩功能
主要用到zip: import java.util.Enumeration; import java.util.zip.CRC32; import java.util.zip.CheckedOutpu ...
- JavaScript实现存储HTML字符串
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head ...
- 洛谷 P1144 最短路计数 Label:水
题目描述 给出一个N个顶点M条边的无向无权图,顶点编号为1-N.问从顶点1开始,到其他每个点的最短路有几条. 输入输出格式 输入格式: 输入第一行包含2个正整数N,M,为图的顶点数与边数. 接下来M行 ...
- 期望dp BZOJ3450+BZOJ4318
BZOJ3450 概率期望DP f[i]表示到i的期望得分,g[i]表示到i的期望长度. 分三种情况转移: ① s[i]=‘x’:f[i]=f[i-1],g[i]=0 ② s[i]=‘o’:f[i]= ...
- js小效果-轮播图
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8" ...
- 无法将Win7安装到GPT分区下解决办法
当出现"您想将windows安装 在何处时",按shift+F10打开命令提示符,输入:diskpartlist disksel disk 0cleanconvert mbr完成转 ...
- e.Handled的理解
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { ...
- 让wego微购购物分享系统采集拍拍数据功能之腾讯paipai功能采集插件
wego是一款很不错的导购系统,无论前后台设计风格和功能都还不错,可有时我们的确需要一些自定义的功能,毕竟万千世界,大家都做一样的东西,采集同样的数据,能不烦吗?哈哈,今天就奉献上一个wego拍拍采集 ...
- 修改wamp默认网站目录
使用WAMP集成环境,如何更改web根目录 做php开发使用WAMP集成环境的同学大部分有过这样的经历: 如果你试图修改web根目录,那么你肯定会想到要修改apache/apache2.2.11/co ...
- JSP + AJAX完整实例及代码
(1)发送请求index.jsp,注意引入jquery.min.js文件 <%@ page language="java" contentType="text/ht ...