<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
  <channel>
    <title>弘帝企业智能建站系统交流平台-芜湖万网信息技术服务中心 - 数据库技术</title>
    <link>http://www.wh.ac.cn/forum.php?mod=forumdisplay&amp;fid=76</link>
    <description>Latest 20 threads of 数据库技术</description>
    <copyright>Copyright(C) 弘帝企业智能建站系统交流平台-芜湖万网信息技术服务中心</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Wed, 08 Apr 2026 00:44:28 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://www.wh.ac.cn/static/image/common/logo_88_31.gif</url>
      <title>弘帝企业智能建站系统交流平台-芜湖万网信息技术服务中心</title>
      <link>http://www.wh.ac.cn/</link>
    </image>
    <item>
      <title>【SQL】设计删除某表行时，同时删除关联表字段值的全部数据的示例</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=3142</link>
      <description><![CDATA[ALTER TABLE [dbo].[AspNetUserRoles] ADD CONSTRAINT [FK_AspNetUserRoles_AspNetUsers_UserId] FOREIGN KEY () REFERENCES [dbo].[AspNetUsers] () ON DELETE CASCADE;

这条 SQL 语句的中文意思是：向名为 \&quot;AspNetUserRoles\&quot; 的表中添加一个名为 \&quot;FK_AspNetUserRol ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Sat, 11 Nov 2023 02:01:24 +0000</pubDate>
    </item>
    <item>
      <title>ACCESS实现ROWNUMBER方法</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=3088</link>
      <description><![CDATA[1、NOT IN，在数据量比较少的前提下使用。
select * from table_name where id_field not in (select top 3 id_field from table_name)

2、左联法
int page = Convert.ToInt32(Request.Form[\&quot;page\&quot;]);
if (page == 0) page = 1;
int pageSize = Convert.ToInt32( ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Sun, 20 Nov 2022 04:24:26 +0000</pubDate>
    </item>
    <item>
      <title>【SQL】查询200行效率比较</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=3051</link>
      <description><![CDATA[declare @d datetime
set @d=getdate()
SELECT TOP 200 * From FreeHost.FreeHost_Product_Domain where id in (SELECT TOP 200 id From FreeHost.FreeHost_Product_Domain Order By endtime ASC) Order By endtime DESC
select [语句执行花费时间(毫秒)]=datediff(m ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Thu, 04 Aug 2022 02:33:00 +0000</pubDate>
    </item>
    <item>
      <title>【SQL】建立多个字段唯一索引</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2993</link>
      <description><![CDATA[原文内容较多，摘自：https://blog.csdn.net/weixin_39571087/article/details/111049524

索引有哪几种类型？
1.主键索引: 数据列不允许重复，不允许为NULL，一个表只能有一个主键。
2.唯一索引: 数据列不允许重复，允许为NULL值，一个表允许多个列创建唯一索引。 ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Tue, 05 Apr 2022 08:30:42 +0000</pubDate>
    </item>
    <item>
      <title>数据库时间日期比较的SQL语句</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2876</link>
      <description><![CDATA[CONVERT(data_type(length),data_to_be_converted,style)

其中，data_type(length)表示为转化后的目标数据类型，并且可以带指定长度。data_to_be_converted为原来的日期/时间字段，style则是转化后的输出格式。

其中，可以使用的style数值包括：
Style ID Style  ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Thu, 19 Nov 2020 06:16:20 +0000</pubDate>
    </item>
    <item>
      <title>MSSQL2008备份出错解决办法！</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2856</link>
      <description><![CDATA[1、开启SQL Agent代理，并保证运行。
2、SQL Aagent服务权限，不能是Network Serives，建议单独的用户，可以是Addministrator
3、初始安装Windows计算机名是A，后改成B后，由于A/Administrator还保存在SQL用户内，可能造成出错（网上有人指出），可以删除administrato ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Sun, 25 Oct 2020 15:40:56 +0000</pubDate>
    </item>
    <item>
      <title>【MSSQL2008】附加数据库没有权限</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2840</link>
      <description><![CDATA[可以尝试添加Network Service，上级目录查看文件夹的权限即可。]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Thu, 01 Oct 2020 09:25:12 +0000</pubDate>
    </item>
    <item>
      <title>【MSSQL2008】星外数据库无法删除用户怎么办？</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2837</link>
      <description><![CDATA[在网上找了很多贴子，没有发现很好的解决方案，大多数都是通过SQL来实现变更所有者
经过摸索，发现要删除用户，会受到同名架构FreeHost的约束，无法删除。
一般来说删除架构后，就可以删除用户了，但发现，由于数据表不是dbo而是FreeHost的，因此架构也无法删除。用SQ ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Wed, 30 Sep 2020 09:03:20 +0000</pubDate>
    </item>
    <item>
      <title>通过维护表的索引来提高数据的访问速度</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2797</link>
      <description><![CDATA[大多数SQL Server表需要索引来提高数据的访问速度，如果没有索引，SQL Server要进行表格扫描读取表中的每一个记录才能找到索要的数据。索引可以分为簇索引和非簇索引，簇索引通过重排表中的数据来提高数据的访问速度，而非簇索引则通过维护表中的数据指针来提高数据的索 ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Tue, 28 Jul 2020 15:56:58 +0000</pubDate>
    </item>
    <item>
      <title>添加自增值ID字段</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2788</link>
      <description><![CDATA[ACCESS:
Alter TABLE table ADD COLUMN ID COUNTER
Alter TABLE table ADD COLUMN ID COUNTER (1000, 1)]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Tue, 23 Jun 2020 02:24:10 +0000</pubDate>
    </item>
    <item>
      <title>按指定ID值顺序排列</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2656</link>
      <description><![CDATA[Access:
select * From 表 Where id in(1,5,3) order by instr(\',1,5,3,\',id)

MSSQL:
select * From 表 Where id in(1,5,3) order by charindex(\',\'+rtrim(cast(id as varchar(10)))+\',\',\',1,5,3,\')

MySQL:
select * From 表 Where id in (1,5,3) order by ins]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Tue, 26 Nov 2019 04:41:02 +0000</pubDate>
    </item>
    <item>
      <title>Sql判断以逗号分隔的字符串中是否包含某个字符串</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2655</link>
      <description><![CDATA[sql语句中，以逗号分隔的字符串中是否包含某个特定字符串，类似于判断一个数组中是否包含某一个元素，例如：判断 ’a,b,c,d,e,f,g‘ 中是否包含 \'a\'，sql语句如何实现？

mysql：
mysql中有一个方法 FIND_IN_SET(ele, str)，str是一个以逗号分隔的字符串，ele是一个 ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Tue, 26 Nov 2019 04:40:41 +0000</pubDate>
    </item>
    <item>
      <title>【MSSQL】新增MSSQL数据库</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2557</link>
      <description><![CDATA[use master
create database HondyCMS
use HondyCMS
create schema HondyCMS 
create login HondyCMS with password=\'sdfas\']]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Mon, 22 Apr 2019 15:39:37 +0000</pubDate>
    </item>
    <item>
      <title>Access添加删除无重复索引SQL</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=2409</link>
      <description><![CDATA[ALTER TABLE 表名 ADD constraint UQ_表_字段 UNIQUE(字段)
ALTER TABLE HD_JP_SiteMenu ADD constraint UQ_JP_SiteMenu_ID unique (HD_ID)

删除某个字段的索引（包括索引：有(无重复)）
Alter TABLE [表名] Drop CONSTRAINT [索引名]

为某个字段添加“索引：有 ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Tue, 26 Jun 2018 04:12:59 +0000</pubDate>
    </item>
    <item>
      <title>【MYSQL】重装和迁移数据发现的种种问题！</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=487</link>
      <description><![CDATA[原机：MYSQL5.0，新机：MYSQL5.5，在不同硬件服务器进行迁移数据的操作。
以下操作针对Windows2003系统。

问题一：更新mysql安装目录内的datadir后，MYSQL不能启动，被逼无奈重新安装MYSQL5.5。
重新安装后，一切按默认进行，到最后过程Start Service无反应，发生M ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Wed, 13 Apr 2016 02:27:22 +0000</pubDate>
    </item>
    <item>
      <title>附加数据库登陆名重建的办法</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=486</link>
      <description><![CDATA[附加数据库后，在登录里重建LoginUser，但是不能绑定数据库，因此不能登陆，所以需要用到以下办法，通常情况下UserName与LoginName是完全一样的。
Use DatabaseName
go
sp_change_users_login \'update_one\', \'UserName\', \'LoginName\'

update_one是存储过程的参数 ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Sun, 10 Apr 2016 08:11:55 +0000</pubDate>
    </item>
    <item>
      <title>ACCESS数据库SQL语句新建，删除，修改表结构</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=409</link>
      <description><![CDATA[ACCESS数据库SQL语句新建，删除，修改表结构  

2009-05-04 15:48:48|  分类： 网站开发 |字号 订阅
新建表： 
create table [表名] 
( 
[自动编号字段] int IDENTITY (1,1) PRIMARY KEY , 
[字段1] nVarChar(50) default \'默认值\' null , 
[字段2] ntext null  ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Mon, 02 Nov 2015 02:45:47 +0000</pubDate>
    </item>
    <item>
      <title>MS Jet SQL技术汇总</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=369</link>
      <description><![CDATA[1、修改字段为无重复索引
CREATE UNIQUE INDEX IX_Name ON HD_Actions(HD_Name) WITH DISALLOW NULL

2、增加字段
ALTER TABLE HD_Privileges Add COLUMN HD_Order TINYINT DEFAULT 0

3、创建表
CREATE TABLE HD_Privileges_Class(HD_ID TINYINT PRIMARY KEY DE ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Sat, 11 Jul 2015 12:02:28 +0000</pubDate>
    </item>
    <item>
      <title>mssql 的日志文件太大了，怎么办？</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=203</link>
      <description><![CDATA[　　一般情况下，SQL数据库的收缩并不能很大程度上减小数据库大小，其主要作用是收缩日志大小，应当定期进行此操作以免数据库日志过大

　　1、设置数据库模式为简单模式:打开SQL企业管理器，在控制台根目录中依次点开Microsoft SQL Server--&gt;SQL Server组--&gt;双击打开 ...]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Mon, 16 Dec 2013 06:58:30 +0000</pubDate>
    </item>
    <item>
      <title>安装MSSQL2000时提示需要CD-KEY，但是无论输什么KEY都提示“无效密钥”的解决方案</title>
      <link>http://www.wh.ac.cn/forum.php?mod=viewthread&amp;tid=201</link>
      <description><![CDATA[1.在开始-运行输入：regedit  可以打开注册表
2.打开注册表后，找到项目HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager看是否存在键SafeDLLSearchMode，如果不存在，则自己添加SafeDLLSearchMode，类型为DWORD，值为0。]]></description>
      <category>数据库技术</category>
      <author>admin</author>
      <pubDate>Tue, 26 Nov 2013 10:49:31 +0000</pubDate>
    </item>
  </channel>
</rss>