随笔分类 -  数据库

摘要:迷你迅雷下载 http://down.sandai.net/mini/MiniThunderInstaller3.1.1.58.exe SqlServer 2008r2下载 ed2k://|file|cn_sql_server_2008_r2_enterprise_x86_x64_ia64_dvd_ 阅读全文
posted @ 2017-05-23 16:16 Rain520 阅读(1551) 评论(0) 推荐(0)
摘要:1.查询 DataBasesID 2.获取进程ID 3.过滤定位 阅读全文
posted @ 2016-07-02 11:34 Rain520 阅读(512) 评论(0) 推荐(0)
摘要:USE [master]GOALTER DATABASE F360DW SET RECOVERY SIMPLE WITH NO_WAITGOALTER DATABASE F360DW SET RECOVERY SIMPLE --简单模式GOUSE F360DWGODBCC SHRINKFILE (N... 阅读全文
posted @ 2015-06-03 13:27 Rain520 阅读(864) 评论(0) 推荐(0)
摘要:Dim_日期:CREATE TABLE [dbo].[Dim_日期]( [日期ID] [varchar](8) NOT NULL, [年] [int] NULL, [半年] [varchar](6) NULL, [季] [varchar](2) NULL, [月] [v... 阅读全文
posted @ 2015-05-07 15:34 Rain520 阅读(838) 评论(0) 推荐(0)
摘要:无法打开用户默认数据库。登录失败。用户‘sa’登录失败。(Microsoft SQL Server, 错误:4064)解决方法:解决方法:先用windows身份验证的方式登录进去,然后在 安全性=》登录=》右键单击 sa=》属性,将默认数据库设置成master,点击确定就可以了。 阅读全文
posted @ 2015-04-23 13:00 Rain520 阅读(758) 评论(0) 推荐(0)
摘要:exec执行sql时字符串时,不能给变量赋值,如果要在sql里给变量赋值,请用EXEC SP_EXECUTESQL示例:通过 SP_EXECUTESQL的第2个参数来定义有哪些参数输出的加OUTPUT 后面的参数为执行的时候,具体参数的数据。输出的加OUTPUT BEGIN DECLARE... 阅读全文
posted @ 2014-12-18 12:31 Rain520 阅读(306) 评论(0) 推荐(0)
摘要:1.Oracle 转义&符号select 'http://localhost:50476/auth/logon?u=user' || chr(ascii('&')) || 'p=8888' from dual; 2.日期转换select to_char(sysdate,'yyyy-mm-dd') ... 阅读全文
posted @ 2014-12-13 14:17 Rain520 阅读(273) 评论(0) 推荐(0)
摘要:示例一:需求:将'1,2,3,4,5,6,7,8,9,10'转成:'1','2','3','4','5','6','7','8','9','10'declare @s varchar(100),@sql varchar(1000)set @s='1,2,3,4,5,6,7,8,9,10'set @s... 阅读全文
posted @ 2014-11-12 10:11 Rain520 阅读(429) 评论(0) 推荐(0)
摘要:管理员身份运行 cmd -> 输入 netsh winsock reset 阅读全文
posted @ 2014-10-12 15:24 Rain520 阅读(1110) 评论(0) 推荐(0)
摘要:with temp as( select 'A01' nation ,1 as S1,2 as S2, 3 as S3 from dual union all select 'A02' nation ,null as S1,5 as S2, 6 as S3 from dual)select ... 阅读全文
posted @ 2014-10-11 00:01 Rain520 阅读(192) 评论(0) 推荐(0)
摘要:首先,如果没有启用xp_cmdshell,请执行以下启用:EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;1.创建映射:exec maste... 阅读全文
posted @ 2014-10-09 17:02 Rain520 阅读(3134) 评论(1) 推荐(0)
摘要:select case when grouping(姓名)=1 then '合计' else cast(姓名 as varchar) end 姓名, case when grouping(学期)=1 and grouping(姓名)=0 then '姓名小计' else cast(学... 阅读全文
posted @ 2014-07-17 13:10 Rain520 阅读(6416) 评论(0) 推荐(0)
摘要:SELECT * FROM [goods] DECLARE test_cursor CURSOR scroll FOR SELECT goods_no, [unitprice] FROM [goods] OPEN test_cursor DECLARE @goodsno INT DECLARE @num numeric(10, 2) FETCH next FROM test_cursor INTO @goodsno, @num WHILE @@FETCH_STATUS = 0 begin PRINT @goodsno ... 阅读全文
posted @ 2014-02-09 15:32 Rain520 阅读(307) 评论(0) 推荐(0)
摘要:1.如果没有启用xp_cmdshell安全配置是不可以使用的--启用xp_cmdshellEXECsp_configure'xp_cmdshell',1GO--重新配置RECONFIGUREGO2.执行脚本xp_cmdshell{'command_string'}[,no_output]如:EXEC xp_cmdshell 'D:\RP\Job\Release\RegentsoftBIService.exe' 阅读全文
posted @ 2014-01-21 17:25 Rain520 阅读(1702) 评论(0) 推荐(0)
摘要:二表数据合并到同一个表:select * from T1select * from T2select a.*,b.OutQty,c.InQty from ( select [DATE] from t1 union select [DATE] from t2) aleft join t1 b on a.[DATE] =b.[DATE] left join t2 c on a.[DATE] =c.[DATE] 阅读全文
posted @ 2014-01-16 14:09 Rain520 阅读(219) 评论(0) 推荐(0)
摘要:1.ROW_NUMBER() OVER函数的基本用法用法http://www.cnblogs.com/fxgachiever/archive/2010/09/15/1826792.html2.DeCode函数:http://www.cnblogs.com/juddhu/archive/2012/03/07/2383101.html3.GROUP BY ROLLUPhttp://hi.baidu.com/420350501/item/a01fdf3ed3a5bb82f4e4ad44http://www.cnblogs.com/simplefrog/archive/2012/07/15/25923 阅读全文
posted @ 2013-10-17 15:00 Rain520 阅读(2905) 评论(0) 推荐(0)
摘要:因为下载mysql需要注册,很麻烦,记录下下载地址:My sql 5.1.71http://cdn.mysql.com/Downloads/MySQL-5.1/mysql-5.1.71-win32.msiMy sql 5.6.13社区版下载页面:http://dev.mysql.com/downloads/mysql/Windows (x86, 32-bit), MSI Installerhttp://cdn.mysql.com/Downloads/MySQLInstaller/mysql-installer-community-5.6.13.1.msiWindows (x86, 64-bit 阅读全文
posted @ 2013-09-03 09:17 Rain520 阅读(4158) 评论(0) 推荐(1)