01 2012 档案
摘要:游标中用到的函数,就是前一篇文章中创建的那个函数。另外,为了方便使用,把游标放在存储过程中,这样就可以方便地直接使用存储过程来执行游标了。 1 create procedure UpdateHKUNo --存储过程里面放置游标 2 as 3 begin 4 5 declare UpdateHKUNoCursor cursor --声明一个游标,查询满足条件的数据 6 for select psn_code from person where type='E' and hku_no is null 7 8 open UpdateHKUNoC...
阅读全文
摘要:一、有返回值的函数View Code create function GetNo()returns varchar(20) --定义返回类型asbegin declare @maxNo int --声明一个整形的变量 declare @temp varchar(20) --声明一个与表中字段类型相同的变量 declare @result varchar(20) --声明一个返回的变量 declare @length int --声明一个变量,用于下面的截取字符串 set @temp = (select max(hku_no) fro...
阅读全文
摘要:很简单的一个例子,先记着,怕忘了这个方法。例子是用VS2003做的,可能有些出入。View Code using System;using System.Text;namespace ASCIIEncodingDemo{ /// <summary> /// Class1 的摘要说明。 /// </summary> class Class1 { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main(stri...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Security.Cryptography;using System.IO;namespace EncryptDemo{ class Program { static void Main(string[] args) { // Create a new DES key. DESCryptoServiceProvider ke...
阅读全文
浙公网安备 33010602011771号