SQL Server bcp
D:\projects\openi\misc\xxxx_data_20090828>bcp [xxxxolap].[dbo].[wdb_cxbz] in wdb_xxx.txt -c -T
SQLState = 37000, NativeError = 4060
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot open database "xxxolap" requested by the login. The login failed.
SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'xxxx\robin'.
解决办法
- MS SQLSERVER MANAGEMENT STUDIO -> SECURITY
- new LOGIN,加入 'xxxx\robin'
- ROLES&MAPPING
相关文档:
1.条件控制
1.1 if .. then .. end if
if 条件 then
语句段;
end if;
1.2 if .. then .. else .. end if
if 条件 then
语句段;
else
语句段;
end if;
1.3 if嵌套
2.循环控制
2.1 loop .. exit .. end loop
loop
& ......
游标是从数据库中提取出来的数据,以临时表的形式存放在内存中,在游标中有一个数据指针,在初始状态下指向首记录, 利用fetch语句移动该指针,从而对游标中的数据进行各种操作。
1.定义游标
cursor 游标名 is select语句;
2.打开游标
open 游标名;
3.提取游标数据
fetch 游标名 into 变量名1, 变量名2, ....;
或
......
1.创建过程
create or replace procedure 过程名 as
声明语句段;
begin
执行语句段;
exception
异常处理语句段;
end;
2. 带参数的过程
参数类型3种
in参数:读入参数,主程序向过程传递参数值
out参数:输出参数,过程向主程序传递参数值
in out参数:双向参数
定义 ......
What is SQL*Plus and where does it come from?
SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts. SQL*Plus is frequently used by DBAs and Developers ......
本文总结了开发工作中常用的SQL语句,供大家参考……
--语 句 功 能
--数据操作
SELECT --从数据库表中检索数据行和列
INSERT --向数据库表添加新数据行
DELETE --从数据库表中删除数据行
UPDATE --更新数据库表中的数据
--数据定义
CREATE TABLE --创建一个数据库表
DROP TABLE --从数据库中删除表
A ......