随笔分类 - sqlserver
摘要:记录一下过程打开vs 新建一个解决方案再新建一个windows服务项目,再新建一个数据库处理类库直接用的SqlHelper,再添加一个应用程序配置文件app.config项目结构如下:windows服务代码1usingSystem;2usingSystem.Collections.Generic;3usingSystem.ComponentModel;4usingSystem.Data;5usingSystem.Diagnostics;6usingSystem.Linq;7usingSystem.ServiceProcess;8usingSystem.Text;9usingSystem.Dia
阅读全文
摘要:先导出表结构 方法是在需要操作的表点右键选择编写脚本为(S)->Create(c)到->新查询器编辑窗口(N)修改该建表方法中的表名称我是直接在原表的后面加上“_Bak”以下是备份、删除、插入sqlinsert into IR_WorkLog_Bak select top 1 * from ir_worklog where worklog_id='01239820120815145624' --插入重复数据到新建的表中delete from ir_worklog where worklog_id='01239820120815145624' --删除
阅读全文
摘要:sql 代码USE [RIFA_IT_PLATFORM]GO/****** 对象: UserDefinedFunction [dbo].[Get_Pid] 脚本日期: 08/15/2012 17:15:47 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER FUNCTION [dbo].[Get_Pid](@ID varchar(50))RETURNS @t_Level TABLE(ID varchar(50),Level int,unitname varchar(50),labellength varchar(50))ASBE
阅读全文