SQL存储过程参数默认值
MS SQL 存储过程参数默认值例子:create procedure pro_Name( @cNo varchar(8), @cName varchar(20)= '%')as begin SQL 语句集……end;goexec pro_name '10002' ,'%' 或exec pro_name '10002'都可以 ,不会报错。[@more@]
领料管理速度慢问题
领料管理:系统越来越慢。PRIFILER跟踪,下面两个语句 消耗I/O 很大,并且将随着系统资料增加而增加。 SELECT Mat_Material.MATNO, Mat_Material.MAT_NM, mat_material.eng_nm, Mat_Material.spec, Mat_Material.CG_Unit, Mat_Material.UNIT, Mat_Material.BL, Mat_Material.SizeFlag, unitweight, '1' as sel , eng_color FROM Mat_Material WHERE isnull(cancelflag,'0')='0' [@more@]/
delphi DBGRID TITLE CAPTION 標題與寬度
// 查詢出來的數據 放入DBGRID裡,並設置 標題頭名稱。procedure TFrm_Wip_Bom.BomBtnClick(Sender: TObject);begin //獲取 BOM數據 Screen.Cursor:=crSQLWait; //鼠標變成漏鬥。 dmqc_c.CD_TMP.Close; dmqc_c.CD_TMP.CommandText:='select b.prod_no, a.model_nob, a.bom_no, a.per_num, a.ver, a.bzdw ' + ', b.ma_no, b.ma_type, b.ma_unit, b.bzyl, b.upuse ,b.jbyl, b.remark from t_bomA a , t_bomb b ' + ' where a. prod_no= b. prod_no and a. prod_no = '+ quotedStr(TYPE_NO_EDT.Text) ;//'''100SDC001I3
简单统计SQL Server用户数据表大小
在SQL Server,简单的组合sp_spaceused和sp_MSforeachtable这两个存储过程,可以方便的统计出用户数据表的大小,包括记录总数和空间占用情况,非常实用,在SqlServer2K和SqlServer2005中都测试通过。[@more@]/**//* 1. exec sp_spaceused '表名' (SQL统计数据,大量事务操作后可能不准) 2. exec sp_spaceused '表名', true (更新表的空间大小,准确的表空大小,但可能会花些统计时间) 3. exec sp_spaceused (数据库大小查询) 4. exec sp_MSforeachtable "exec sp_spaceused '?'"
玻璃規格中提取玻璃厚度
玻璃規格中提取玻璃厚度 select C.id,c.mc, substring(M.glassT,CharIndex('*',M.GLassT,5)+1,CharIndex('t',M.GLassT)-CharIndex('*',M.GLassT,5) ) as GL , M.glassT from t_makep m, t_Combo C, t_make_inf A where c.id=m.MNAME and c.app_id='t_makep' and c.lb='GZMS' AND A.ENG_NO=M.ENG_NO and A.MAKE_no='D1B2FE343' 因,玻璃規格輸入規範性約束不強,有些提取不到有效值. 例如:(1) 14"*16"*1.1tSP (2)12.6"*14"*0.55t CharIndex('*', Str_source,第N個字符開始); 問題點:CHARINDEX(
delphi 7 判斷是否為零函數
delphi 7 判斷是否為零函數[@more@]function is_null(col:string ):real;begin if adodm.CD_search.FieldByName(col).IsNull then begin result :=0 ; end else begin result:=adodm.CD_search.FieldValues[col]; end;end;
查找没有加工明细
-- crter:建立者,part_no:部位号,matNo:物料编号,mat_nm:物料名称,,crtdt:建立日期 ,splNo:样品号 select top 99 * from Style_stru_SampleList where splNo = '080828008' order by ypseq select top ...
delphi COMBOBOX里显示DBGRID列名
COMBOBOX里显示DBGRID列名。{ DBGRID1里有三个列名(编号,名称,备注)查询语句:select * from tb where combobox1.text = edit1.textDBGRID所有列名都作为了查询条件了。}[@more@]procedure TForm1.ComboBox1DropDown(Sender: TObject);vari:integer;begincombobox1.Clear;//for i:=0 to 2 do //这里的2 最好用获取DBGRID列数。for i:=0 to adoquery1.FieldCount-1 dobegincombobox1.Items.Add(dbgrid1.Columns[i].Title.caption ) ;end;end; {COMBOBOX显示数据表的列名。TB表 有TNO,TNAME,TMEMO三个列名。注:TB表列名添加 到adoquer
myEclipse6.5_struts实践例子 --Struts-config.xml
续《myEclipse6.5_struts实践例子》STRUTS-CONFIG.XML 文件中的配置文件内容:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1...
MySQL自动递增字段的创建方法
Normal 0 0 2 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-siz
MSSQL 查询重复记录
---查询重複資料 SELECT MAKE_NO,FLOWNO,EMPLOYEEID, COUNT(EMPLOYEEID) FROM T_BADnESS GROUP BY MAKE_NO,FLOWNO ,EMPLOYEEIDHAVING COUNT(EMPLOYEEID) >=2[@more@]
WINDOWS 7 系统U盘不能用
WINDOWS 7 系统经常出现USB接口不能用,使 U盘不能用。设备属性显示:Windows 无法加载这个硬件的设备驱动程序。驱动程序可能已损坏或不见了。 (代码 39)
檢測業務訂單的 回單日期有效性
ORACLE没有 检测是否为日期类型的函数,为此,针对某一列的数据,可能用已知的某两格式 进行查询。 -- 檢測業務訂單的 回單日期有效性(備註欄位) select ORDER_NUMBER , ATT...
Redhat 5 中网卡ip的设置
vi /etc/sysconfig/network-scripts/ifcfg-eth0动态:DEVICE=eth0BOOTPROTO=dhcpHWADDR=00:0C:29:A2:5C:3FONBOOT=yesTYPE=Ethernet 静态:DEVICE=eth0BOOTPROTO=staticIPADDR=192.168.0.124NETMASK=255.255.255.0GATEWAY=192.168.0.1HWADDR=00:0C:29:A2:5C:3FONBOOT=yesTYPE=Ethernet 重启,使生效service network restart[@more@]
正数与负数对冲
仓库表里有正数和负数,现在需要将负数去掉。例如: 物料编号 物料料名 数量 单位 录入日期 a01 AA 50 T 20071023 a02 BB 60 T 20071023 a01 ...
科目显示科目描述
科目显示科目描述SELECT apps.gl_flexfields_pkg.get_description_sql(&char_of_account_id, 1, gcc.segment1) seg1, gl_flexfields_pkg.get_description_sql(&char_of_account_id, 2, gcc.segment2) seg2, gl_flexfields_pkg.get_description_sql(&char_of_account_id,
订单材料统计表_季度
if exists (select 1 from sysobjects where name ='pro_Bom_AllSum' and type = 'p' )begin[@more@]drop procedure pro_bom_Allsum/* 说明:订单材料统计表,两订单查询范围,一个小范围,一个大范围注意:小范围订单一定要在大范围内,否则计算正确 ,如 小范围 A0904-012到A0904-023 ,大范围则 A0904-001到A0904-030产生表结构:物料编号,物料名称,小范围用量,大范围用量,单位格式: exec pro_bom_AllSum 小范围开始订单号,小范围结束订单号 ,大范围开始订单号,大范围结束订单号 Author:SamBuild Date: 2009-04-16Update date:
服务器修改密码SQL SERVER不能启动
windows XP 安装SQL SERVER 2000 后,修改WINDOWS ADMINISTRATOR(或用户)密码后,SQL SERVER 2000 不能登陆。解决方法:控制面板--》管理工具--》服务--》右击“MSSQLSERVER”--》属性--》登陆--》选择“本地系统账户”[@more@]
解除禁用鼠标
浏览网页时发现越来越多的网页把鼠标右键禁用起来,个人认为这种行为是欺负网络新人。网络是信息传播最快的媒体。怎样才可以把我们找到信息保存起来呢?我来说一下:高手们不要见怪;以IE浏览器为例:查看--->原始文...
订单复制样品BOM 必须优化
以下必须优化它太慢了。Select count ( a.style_no ) From style_stru_samplelist a , mat_material b Where a.matno =b.matno and b.jgflag ='1' and a.splno ='090207094' and a.style_no ='AA70087-29' and convert ( varchar ( 10 ) , flowno ) + a.matno not in ( select convert ( varchar ( 10 ) , flowno ) + matno from style_stru_samplelist_jg ) READS=212477,CPU=2188,DURATION=80970订单复制样品BOM时其中一个语句。[@more@]