c# 操作mssql数据库 含有带参数sql语句运行
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Default" value="Default" />
</appSettings>
<connectionStrings>
<add name="Default" connectionString="Data Source=192.168.1.197;User ID=diamond;Password=88888888;Initial Catalog=EmailAnalyse" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
namespace OfficeOutlook
{
/// <summary>
///DataBase 的摘要说明
/// </summary>
public class DataBase
{
protected SqlConnection BaseSqlConnection = new SqlConnection();//连接对象
protected SqlCommand BaseSqlCommand = new SqlCommand(); //命令对象
public DataBase()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
protected void OpenConnection()
{
if (BaseSqlConnection.State == ConnectionState.Closed) //连接是否关闭
try
{
&nb
相关文档:
作者:邱洋
QQ:1964477
虽然在hibernate中有show_sql选项,但是显示出来的语句大多类似
select * from xxx where value=?
但是有时候我们需要得到完整的SQL语句,怎么办呢?使用P6SPY就可以完成这个任务
p6spy是一个开源软件,它可以跟 ......
create PROCEDURE zdy_CBFY (@SFSS VARCHAR(1),@DWBH varchar(20),@KMBH VARCHAR(10),@KJND VARCHAR(4))
AS
DECLARE @ZWkmye varchar(20),@zwkmzd varchar(20),@ZWSSKMYE varchar(20)
set @zwkmye='zwkmye'+@kjnd
SET @ZWKMZD='ZWKMZD'+@KJND
SET @ZWSSKMYE='ZWSSKMYE'+@KJND
其 ......
sql server 临时表的使用 以及给临时表插入主键列
--某时间段内某组服务器的消费排行
CREATE PROCEDURE biling_order_consume
@begin_date datetime,
@end_date datetime
AS
select identity(int,1,1) as ID,charge_credit into #tmp from crm_biling
where @begin_date <= convert(datetime,convert( ......
用户、组或角色′sde'在当前数据库中已存在
Use dbName
go
sp_change_users_login ‘update_one’
,
‘loginName’
, ‘loginName‘
摘自:http://www.softbunny.net/post/SQL_Login_User.shtml
......
1 如何锁一个表的某一行
A 连接中执行
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
begin tran
selec ......