BuildQuery A Simple SQL Query Tool
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BuildQuery
{
/// <summary>
/// 使用提供的数据建立一个SQL查询
/// </summary>
public class BuildQuery
{
#region 类的变量
int numFieldsCount, dispos; //字段数量,记录逗号的数量
//
//将所有的字段和值放入到Dictionary集合里,提高操作效率
//
Dictionary<string, string> dicFields = new Dictionary<string, string>(); //字段集合
Dictionary<string, string> dicData = new Dictionary<string, string>(); //值的集合
Dictionary<string, bool> dicQuotes = new Dictionary<string, bool>(); //是否需要引号的集合
//
//条件字段及值的集合
//
List<string> listIDFields = new List<string>(); //字段集合
List<string> listIDValues = new List<string>(); //值的集合
List<bool> listIDQuotes = new List<bool>(); //引号集合
List<string> listIDOperators = new List<string>();//操作符集合
string strTable; //表名
Boolean IdentityCheck; //是否需要返回一个新的实体类
/// <summary>
/// 封装一个是否需要新的实体类
/// </summary>
public Boolean GetIdentity
{
get { return IdentityCheck; }
set { IdentityCheck = value; }
}
/// <summary>
/// 封装返回一个查询的结果
/// </summary>
public string Table
{
get { return strTable; }
set { strTable = value; }
}
#endregion
/// <summary>
/// 类的实例化构造方法
/// </summary>
public BuildQuery()
{
}
/// <summary>
/// 建立一个查询前清除DICTIONARY集合的所有内容
/// </summary>
publ
相关文档:
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++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......
在这一页中,我们列出所有在这个网站有列出 SQL 指令的语法。若要更详尽的说明,请点选指令名称。
这一页的目的是提供一个简洁的 SQL 语法做为读者参考之用。我们建议您现在就按 Control-D 将本页加入您的『我的最爱』。
Select
SELECT "栏位" from "表格名"
Distinct
SELECT DISTINCT "栏位"
from "表格名"
......
这几天写存储过程,每天定时差异备份,并自动发邮件给操作人修改要修改的内容。 在这里写出sql server的代理操作,接下来把写的发邮件的存储过程也发出。大家作个参考
如果在sql server 里需要定时或者每隔一段时间执行某个存储过程或3200字符以内的sql语句时,可以用管理->sql server代理->作业来实现。
  ......
[转载]http://www.cnblogs.com/cn_wpf/,非常感谢Nineteen@newsmth 的分分享。
写有效率的SQL查询(I)
大型系统的生产环境,一般情况下,我们评价一条查询是否有效率,更多的是关注逻辑IO(至于为什么,回头补一篇)。我们常说,“要建彪悍的索引”、“要写高效的SQL”,其实最终目的就是在相 ......