上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页
  2009年6月18日
摘要: create table textvalue (IDtext ntext)godeclare @cunt intset @cunt=1while @cunt <200 begin insert into textvalue values(CAST(@cunt*1000.111111 as varchar(max))) endgoselect * from textvaluego/*select replace(cast(IDtext as varchar(100)),'.','+') from textvalue where IDtext like  阅读全文
posted @ 2009-06-18 16:20 叮叮猫的编程世界 阅读(154) 评论(0) 推荐(0) 编辑
  2009年6月17日
摘要: create table tablea( tid int , mid int)gocreate table tableb( fid int, tid int)gobegin declare @coun int set @coun=1 while @coun<20 begin insert into tablea values(20,@coun) insert into tableb values(@coun,@coun) set @coun=@coun+1 endendgoupdate tablea set tablea.tid=tableb.fidfrom tablebwhere ta 阅读全文
posted @ 2009-06-17 17:20 叮叮猫的编程世界 阅读(275) 评论(0) 推荐(0) 编辑
  2009年6月16日
摘要: create table [Data_NewTrayGuide_Picture]( [vpictureid] int IDENTITY(1,1) NOT NULL, [VID] int not null, [title] varchar(2000) not null)go/**********插入测试数据*******************/declare @a int,@vid int set @a=10 while @a<=200 begin set @vid=@a/4 insert into [Data_NewTrayGuide_Pictu... 阅读全文
posted @ 2009-06-16 17:03 叮叮猫的编程世界 阅读(1104) 评论(0) 推荐(0) 编辑
  2009年6月11日
摘要: create table tableA(tid int not null,mid int not null)goinsert into tableA values(2,2) insert into tableA values(3,3) insert into tableA values(4,4) insert into tableA values(5,5) create table tableB(fid int not null,tid int not null)goinsert into tableB values(1,2)insert into tableB values(1,3)inse 阅读全文
posted @ 2009-06-11 17:33 叮叮猫的编程世界 阅读(149) 评论(0) 推荐(0) 编辑
  2009年6月8日
摘要: collate chinese_prc_ci_as null 是什么意思我们在create table时经常会碰到这样的语句,例如:CorpName nvarchar(10) collate chinese_prc_ci_as null,那它到底是什么意思呢?不妨看看下面:语法COLLATE < collation_name >< collation_name > ::= { Windows_collation_name } | { SQL_collation_name }参数collation_name是应用于表达式、列定义或数据库定义的排序规则的名称。collati 阅读全文
posted @ 2009-06-08 16:38 叮叮猫的编程世界 阅读(284) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;using System.Web;namespace CrazyCoder.Common{/// <summary> /// 汉字转拼音类 /// by http://www.crazycoder.cn /// build Date 20030610 /// </summary> public class CrazyCoderPinyin { ... 阅读全文
posted @ 2009-06-08 16:31 叮叮猫的编程世界 阅读(134) 评论(0) 推荐(0) 编辑
摘要: create function fun_getPY(@str nvarchar(4000)) returns nvarchar(4000) as begin declare @word nchar(1),@PY nvarchar(4000) set @PY='' while len(@str)>0 begin set @word=left(@str,1)--截取一个字符串出来 --如果非汉字字符,返回原字符 set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901 then (... 阅读全文
posted @ 2009-06-08 16:24 叮叮猫的编程世界 阅读(211) 评论(0) 推荐(0) 编辑
  2009年6月4日
摘要: DECLARE @TableName varchar(100) --定义存储表名称DECLARE staff_cursor CURSOR FOR --定义游标进行操作 SELECT [name] FROM sys.sysobjects WHERE type='U' -- 打开游标 OPEN staff_cursor -- 提取记录数据 FETCH Next FROM staff_cursor Into @TableName WHILE @@fetch_status = 0 BEGIN EXEC('DROP TABLE... 阅读全文
posted @ 2009-06-04 11:36 叮叮猫的编程世界 阅读(154) 评论(0) 推荐(0) 编辑
  2009年5月27日
摘要: 在你想要查询的数据库里面进行执行:/* 版本号: 2009-5-31 作 者: 叮叮猫 适用环境: SQL2005或2005以上 适用情景: 例如你是进入公司的,或者这个数据库你已经很久没有看过了忘记里面字段的用途, 但是你又必须对这个公司的数据里面的数据库不甚了解 你想了解这个数据库的字段的一些说明 你就需要使用他了。当然前提条件是他的字段里面 有这个字段的相关说明 */SELECT (case when a.colorder=1 then d.name else '' end) as 表名,--如果表名相同就返回空 a.colorder as 字段序号, a.name as 阅读全文
posted @ 2009-05-27 09:31 叮叮猫的编程世界 阅读(190) 评论(0) 推荐(0) 编辑
  2009年5月13日
摘要: /*---------------------------------版本号: 2009-5-20作 者 : 叮叮猫起作用 只针对对数据的内表的增加 删除修改但是当你对数据库内数据的操作 是不能进行捕获的----------------------------*/USE testDBGO USE [testDB]GOcreate table [DatabaseLog] --创建一张表进行查询([PostTime] datetime, [DatabaseUser] xml, [Event] xml, [Schema] xml, [Object] xml, [TSQL] xml, [Xm... 阅读全文
posted @ 2009-05-13 10:45 叮叮猫的编程世界 阅读(130) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页