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 ...
随机推荐
- javascript 返回字符长度,中文为两个字节,英文为一个字节
//正则:用于区分中文为两个字节function getLength(str){ return String(str).replace(/[^\x00-\xff]/g,'aa').length; ...
- 简单图解设置MYSQL可以通过其他机器远程访问,开启远程访问权限
开始,运行---cmd,然后cd到mysql.exe目录,然后照着下图红色框中输入 注意: 1.MySQL 5.7查询时候应该输入select host,user,authentication_str ...
- HDU 4758 Walk Through Squares(AC自动机+DP)
题目链接 难得出一个AC自动机,我还没做到这个题呢...这题思路不难想,小小的状压出一维来,不过,D和R,让我wa死了,AC自动机,还得刷啊... #include<iostream> # ...
- IOS开发常用设计模式
IOS开发常用设计模式 说起设计模式,感觉自己把握不了笔头,所以单拿出iOS开发中的几种常用设计模式谈一下. 单例模式(Singleton) 概念:整个应用或系统只能有该类的一个实例 在iOS开发我们 ...
- JS调用水晶报表打印翻页按钮事件
默认的水晶报表打印按钮.翻页按钮太小,并且样式不好调整,考虑自己做一个按钮,然后调用水晶报表的按钮事件. 在实际操作中发现可以在.net按钮的服务器端事件中调用翻页方法: CrystalReportV ...
- GO语言练习:多返回值函数
1.代码 2.运行 1.代码 package main import ( "fmt" "strconv" ) func getValue(n int) (flo ...
- How does controller listen to service?
Polling. The Controller periodically asks the Service for the latest data. IMHO, this option sucks, ...
- wego微购RSS、Sitemap、Ping、腾讯拍拍网购采集插件
和哥们研究淘宝客,找到微购这个程序觉得挺不错的,但是地图和RSS功能不是特别完善,于是小憩一下,做了下初级的拓展,分享给大家,开源精神嘛,大家也可以去我的网站我要购物平台去看看. 1.拓展后台seoA ...
- IO流,File类的测试........课堂加总结
package liu0926; import java.io.File; import java.io.IOException; public class Text01 { public stati ...
- 【8.0、9.0c】树形列表 列标题 不对齐的问题及解决方案
树形视图状态经常会碰到字体上下排列不整齐的问题,虽不是什么大问题,但对某些处女座的人来说,真的是如鲠在喉,今天我们就来解决这个问题: 首先呢,这个问题的起因,不是前端css的问题,也不是js的问题,而 ...