原文:如何使用OPENQUERY访问另一个SQL Server 在项目中,经常会遇到一个数据库访问另一个数据库,[CNVFERPDB]为服务器名,[CE3]为库名 SELECT Dtl.* FROM CNVFERPDB. CE3.ce3.ZTLE0125 Dtl INNER JOIN CNVFERPDB.CE3.ce3.ZTLE0124 Mst ON Dtl.RECVSUPPNO = Mst.RECVSUPPNO AND Dtl.MANDT = Mst.MANDT ' and Dtl.BRAND…
这篇短文将介绍几种拷贝 SQL Server 表的方法.第一种方式是最简单的在同一个数据库里将表拷贝到另外一个表.你需要记住的是,拷贝表的时候并不会拷贝表的约束和索引.下面是代码模板和简单的使用方法: select * into <destination table> from <source table> Example: Select * into employee_backup from employee 我们也可以只拷贝某些字段: select col1, col2, co…
use localdb sometime is easy than sql server ,and always use visual studio make you stupid. vs2012中还原数据库到 localdb 实例,在vs的sql server服务器中连接上(localdb)\v11.0后,打开新建查询输入一下语句: 使用类似以下语句 restore database EasyWeixin from disk='E:\wx002\EasyWeixin.bak' with…
[学习笔记] 7.jdbc的transaction例子: import java.sql.*; public class MySQlTransaction1 { public static void main(String[] args) throws SQLException {/*in my sql: create table Accounts( ID int(4) not null, NAME varchar(15), …
[新手可忽略不影响继续学习]下面例子中setYear中的return this;返回了一个指向对象的指针,this.setMonth(8).setDay(20);是合法的,如果像原来的例子一样什么都不返回,就成了void.setMonth(8).setDay(20); 马克-to-win,系统就该报错了 class MyTestDate { int year; int month; MyTestDate(int year, int month, int day) { …