随笔分类 -  sql

摘要:C:\Program Files\Microsoft SQL Server\MSSQL15.SQL2019\MSSQL\Log\Polybase\dump 全部删掉 阅读全文
posted @ 2022-11-16 11:29 恋之呓 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-07-15 17:10 恋之呓 阅读(62) 评论(0) 推荐(0) 编辑
摘要:osql -S 主机名 -U 用户名 -P 密码 -i E:\20190723.sql 阅读全文
posted @ 2019-07-23 11:27 恋之呓 阅读(4612) 评论(0) 推荐(0) 编辑
摘要:use tax_ceshiselect 'DROP TABLE '+name from sysobjects where type = 'U'union select 'DROP VIEW '+name from sysobjects where type = 'V' unionselect 'DR 阅读全文
posted @ 2019-02-20 09:39 恋之呓 阅读(391) 评论(0) 推荐(0) 编辑
摘要:右击表 =》点属性 =》扩展属性 =》加 MS_Description 阅读全文
posted @ 2018-11-19 11:17 恋之呓 阅读(229) 评论(0) 推荐(0) 编辑
摘要:SELECT CASE WHEN col.colorder = 1 THEN obj.name ELSE '' END AS 表名, Coalesce(epTwo.value, '') AS documentation, col.colorder AS 序号 , col.name AS 列名 , I 阅读全文
posted @ 2018-11-19 11:08 恋之呓 阅读(2203) 评论(0) 推荐(0) 编辑
摘要:sqlserver 删除表结构use IndividualTaxGOdeclare @sql varchar(8000)while (select count(*) from sysobjects where type='U')>0beginSELECT @sql='drop table ' + n 阅读全文
posted @ 2018-11-15 14:30 恋之呓 阅读(919) 评论(0) 推荐(0) 编辑
摘要:use storeGOdeclare @sql varchar(8000)while (select count(*) from sysobjects where type='U')>0beginSELECT @sql='drop table ' + nameFROM sysobjectsWHERE 阅读全文
posted @ 2018-09-14 09:07 恋之呓 阅读(418) 评论(0) 推荐(0) 编辑
摘要:select stuff((select ','+w.Waybillno from Web_Way_Waybill w where w.IsValid<>'Y' AND w.TruckOrder='T1712220007' FOR XML PATH('')),1,1,''))+ left(',,,, 阅读全文
posted @ 2017-12-25 14:20 恋之呓 阅读(332) 评论(0) 推荐(0) 编辑
摘要:#region 导入订单 protected override string DoExcelData(System.Data.DataTable dt) { string data = ""; try { if (dt.Rows.Count == 0) { return "excel中无数据"; } 阅读全文
posted @ 2017-09-28 14:18 恋之呓 阅读(761) 评论(0) 推荐(0) 编辑
摘要:创建链接服务器 exec sp_addlinkedserver 'ITSV ', ' ', 'SQLOLEDB ', '远程服务器名或ip地址 ' exec sp_addlinkedsrvlogin 'ITSV ', 'false ',null, '用户名 ', '密码 ' --查询示例 selec 阅读全文
posted @ 2017-08-07 14:39 恋之呓 阅读(201) 评论(0) 推荐(0) 编辑
摘要:select * into #t from OPENROWSET( 'SQLOLEDB','SERVER=192.168.90.18;uid=sa;pwd=Mm-000000;Database=tms', 'SET FMTONLY OFF;set nocount on;exec Sys_Index_ 阅读全文
posted @ 2017-05-12 13:15 恋之呓 阅读(1208) 评论(0) 推荐(0) 编辑
摘要:USE [tms]GO/****** Object: UserDefinedFunction [dbo].[fn_StrToTable_Double] Script Date: 2017/4/26 9:07:38 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTI 阅读全文
posted @ 2017-04-26 09:08 恋之呓 阅读(313) 评论(0) 推荐(0) 编辑
摘要:USE [tms]GO/****** Object: UserDefinedFunction [dbo].[StrToTable] Script Date: 2017/4/26 9:06:20 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOA 阅读全文
posted @ 2017-04-26 09:07 恋之呓 阅读(2689) 评论(0) 推荐(0) 编辑
摘要:USE [tms]GO/****** Object: UserDefinedFunction [dbo].[fn_ConvertListToTable_Sort] Script Date: 2017/4/26 9:04:51 ******/SET ANSI_NULLS ONGOSET QUOTED_ 阅读全文
posted @ 2017-04-26 09:06 恋之呓 阅读(253) 评论(0) 推荐(0) 编辑
摘要:select tbl2.id,tbl2.TitleName,tbl1.[1],tbl1.[2],tbl1.[3],tbl1.[4] from (select * from (SELECT [MainId] ,[SAnswer] ,Row_Number() OVER(partition by main 阅读全文
posted @ 2017-02-24 13:40 恋之呓 阅读(101) 评论(0) 推荐(0) 编辑
摘要:--/第1步**********删除所有表的外键约束*************************/ DECLARE c1 cursor for select 'alter table ['+ object_name(parent_obj) + '] drop constraint ['+nam 阅读全文
posted @ 2016-12-19 14:31 恋之呓 阅读(553) 评论(0) 推荐(0) 编辑
摘要:use TEST go if exists(select * from sysobjects where name='sp_query_bankMoney') drop procedure sp_query_bankMoney go create procedure sp_query_bankMon 阅读全文
posted @ 2016-07-06 15:46 恋之呓 阅读(132) 评论(0) 推荐(0) 编辑
摘要:use TEST go if exists(select * from sysobjects where name='Student') drop table Student go create table Student ( StudentID int primary key, Name nvar 阅读全文
posted @ 2016-07-06 14:37 恋之呓 阅读(135) 评论(0) 推荐(0) 编辑
摘要:这是数据库外键定义的一个可选项,用来设置当主键表中的被参考列的数据发生变化时,外键表中响应字段的变换规则的。update 则是主键表中被参考字段的值更新,delete是指在主键表中删除一条记录:on update 和 on delete 后面可以跟的词语有四个no action , set null 阅读全文
posted @ 2016-04-27 09:02 恋之呓 阅读(239) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示