SqlServer 一些操作
//查询一个表中的某字段为条件修改另一个表的内容
update [VehicleInsuranceAgentConfiguration] set Keyword2=PC.ServerConfig from ProxyConfig PC,VehicleInsuranceAgentConfiguration VIAC
where VIAC.CompanyID=PC.CompanyID and VIAC.ProductCode=PC.ProductCode
//修改表中字段的类型 长度
Alter Table 表名 ALTER COLUMN 列名 类型(长度)
Alter Table [VehicleInsuranceAgentConfiguration] ALTER COLUMN Keyword2 nvarchar(max)
//修改表字段名
EXEC sp_rename '[ServiceConfig].[ServerName]', 'CompanyID', 'COLUMN'
//添加一个字段
alter table [chexian].[dbo].[ServiceConfig] add CompanyID nvarchar(50)
//修改默认值
ALTER TABLE dbo.UPLOADED_FILES ADD DEFAULT(NEWID()) FOR FILE_ID
SqlServer 一些操作的更多相关文章
- 【转载】微软官方提供的Sqlserver数据库操作帮助类SQLHelper类
在.NET平台中,C#语言一般使用ADO.NET组件来操作Sqlserver数据库,通过ADO.NET组件可以实现连接数据库.查询数据集.执行SQL语句以及关闭数据库连接等操作,为此网上有很多开发者自 ...
- Sqlserver日期操作
Sqlserver日期操作 select GETDATE() as '当前日期', DateName(year,GetDate()) as '年', DateName(month,GetDate()) ...
- SQLserver数据库操作帮助类SqlHelper
1 SqlHelper源码 using System; using System.Data; using System.Xml; using System.Data.SqlClient; using ...
- SQLServer数据操作(建库、建表以及数据的增删查改)
SQLSever数据操作 一.建立数据库: create database DB ---数据库名称 ( name=data1 --文件名, ...
- C# 连接 SQLServer 及操作
随笔:连接: // 将tb_User表数据添加到DataGridView中 string sqlconn = "Data Source=localhost;Initial Catalog=d ...
- sqlserver 表操作 SQL篇
数据库知识点 1.数据库操作: 增:insert into 表名 values(值1,值2,值3) 删:delete 列名 from 表名 where 条件 改:update 表名 set =值 wh ...
- (转)SQLServer分区表操作
原文地址:https://www.cnblogs.com/libingql/p/4087598.html 1. 分区表简介 分区表在逻辑上是一个表,而物理上是多个表.从用户角度来看,分区表和普通表是一 ...
- SQLServer数据操作(建库、建表以及数据的增删查改)[转]
SQLSever数据操作 一.建立数据库: create database DB ---数据库名称 ( name=data1 --文件名, filename ...
- SqlServer知识点-操作xml
一.开发环境 SQL2010 二.开发过程 1.声明一个xml类型变量 DECLARE @xmlInfo XML; SET @xmlInfo = '<CompanyGroup> <C ...
- 通过sqlserver用户操作远程服务器
USE masterGORECONFIGURE --先执行一次刷新,处理上次的配置GOEXEC sp_configure 'show advanced options',1 --启用xp_cmdshe ...
随机推荐
- Linux字符设备驱动结构(一)--cdev结构体、设备号相关知识机械【转】
本文转载自:http://blog.csdn.net/zqixiao_09/article/details/50839042 一.字符设备基础知识 1.设备驱动分类 linux系统将设备分为3类:字符 ...
- 所谓完整的linux系统包括哪些部分呢?【转】
本文转载自:http://www.eeskill.com/article/index/id/1358.html 简介:三部分:bootloader.linux kernel(linux内核).root ...
- 数据库日期格式为int型时存取格式
存入当前日期:time() 取出并转化为日期格式:date('Y-m-d H:i:s',strtotime($time)); 最好在前面加上这句: date_default_timezone_set( ...
- tomcat缓存静态资源深入
之前看过apach及nginx对于静态资源(含js,图片,css等)部分的缓存,用于加速并减轻后台实际web服务器的压力. 静态资源缓存是WEB服务器优化的一种手段,基本原理如下: 1.客户端浏览器请 ...
- mysql 利用binlog增量备份,还原实例
mysql 利用binlog增量备份,还原实例 张映 发表于 2010-09-29 分类目录: mysql 标签:binlog, mysql, mysqldump, 增量备份 一,什么是增量备份 增量 ...
- 启动hadoop报192.168.1.151: Address 192.168.1.151 maps to node1, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
使用root用户启动hadoop的时候报错: [root@node1 ~]# su - hadoop -c start-all.sh starting namenode, logging to /ap ...
- memcache缓存的使用
今天在,本地测试了一个关于memcache的demo. 本地集成环境(wamp)环境如下:php 5.5.12 .Apache 2.4.9 .mysql 5.6.17 1.除了添加配置.添加php的 ...
- Eclipse编译器及一些jdk + notepad
Eclipse32位系统 http://pan.baidu.com/s/1i3eU8V7 Eclipse64位系统 http://pan.baidu.com/s/1i36ERCp jdk64位 htt ...
- phpcms 04
首页index.html 首页头条推荐 <div class="col-left"> <div class="news-hot"> &l ...
- 2016年10月29日 星期六 --出埃及记 Exodus 19:14
2016年10月29日 星期六 --出埃及记 Exodus 19:14 After Moses had gone down the mountain to the people, he consecr ...