SQL链接数据库
Standard Security:
"Data Source=Aron1;Initial
Catalog=pubs;User Id=sa;Password=asdasd;"
- or -
"Server=Aron1;Database=pubs;User
ID=sa;Password=asdasd;Trusted_Connection=False"
(both
connection strings produces the same result)
Trusted Connection:
"Data
Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
- or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
(both connection strings produces the same result)
(use serverName\instanceName as Data Source to use
an specifik SQLServer instance)
Connect via an IP
address:
"Data Source=190.190.200.100,1433;Network
Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the
Data Source is the port to use (1433 is the default))
Enabling MARS (multiple active result sets):
"Server=Aron1;Database=pubs;Trusted_Connection=True;MultipleActiveResultSets=true"
Note! Use &nbs
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......
--A. 从存储在非类型化的 xml 变量中的文档中删除节点
DECLARE @myDoc xml
SET @myDoc = '<?Instructions for=TheWC.exe ?>
<Root>
<!-- instructions for the 1st work center -->
<Location LocationID="10" LaborHours="1.1" MachineHours=".2" >
Some text 1
<st ......
use Tempdb
go
if object_ID('fn_ACITEncryption') is not null
drop function fn_ACITEncryption
go
create function fn_ACITEncryption
(
@Str nvarchar(4000),--加密的字符串
@Flag bit=1,--1、加密 0、解密
@Key nvarchar(50)--密文
)
returns nvarchar(4000)--這里可轉換 ......
【1】
create procedure proc_pager1
( @pageIndex int, -- 要选择第X页的数据
@pageSize int -- 每页显示记录数
)
AS
BEGIN
declare @sqlStr varchar(500)
set @sqlStr='select top '+con ......