很久没用使用SQL SERVER数据库了,今天在win7下连接SQL2005服务器时遇到“在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)”错误,于是到“SQL Server 外围应用配置器”中设置“远程连接”却又遭遇到“SetEnable对于ServerPro...
64位win下使用ADODB.Connection 连接mysql odbc失败的总结1.在64位Windows系统中,默认数据源(ODBC)是64位的,包括控制面板-》管理工具-》数据源 或在运行中直接运行ODBCAD32程序。如果客户端是32位应用程序,仍然需要配置32位ODBC数据源,这时需要运行C:\Windows\SysWOW64\odbcad32.exe来启动ODBC数据源管理器,添加32位的ODBC数据源。2.下载了64位Mysql Connectors导致花费大量时间研究为...
DECLARE @SQL VARCHAR(MAX); SET @SQL='' SELECT @SQL=@SQL+'; KILL '+RTRIM(SPID) FROM master..sysprocesses WHERE dbid=DB_ID('ThunderERP'); EXEC(@SQL); GO alter database ThunderERP set multi_user
--把cards和card_id换成自己的表名和字段方法一 select a.rownumber from (select ROW_NUMBER() over(order by card_id) as rownumber,card_id from cards) a left join cards c on a.rownumber=c.card_id where c.card_id is null 方法二if exists(select 1 from sysobjects where id...
--把出多条备注信息拼成一个字符串,每条备注用“;”隔开select 备注=(stuff((select ' ; ' + remark_content from ProjectRemark pjr where pjr.Project_ID= p.Project_ID group by pjr.project_id,pjr.remark_content for xml path('')),1,1,'') )from Projects p,Proj...
环境准备MySQL8.0.11 Windows zip包下载地址:https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-winx64.zip 系统环境:Windows 101.加压安装包到安装目录我的目录是:D:\programs\MySQL12 2.配置文件 解压后的目录不存在 my.ini 文件,自己创建并编辑如下内容 注意:把 basedir 换成自己的mysql安装目录, datadir 同理[mysqld] #设置3306...
一、查询数据库和表的大小1.查询所有数据库占用磁盘空间大小的SQL语句select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),'MB') as data_size,concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_sizefrom information_schema.tablesgroup by TABLE_SCHEMAorder by ...
--将酒水组表的主键改为非自增的alter table RecipeGroups add useridtmp int nullgoupdate RecipeGroups set useridtmp = RecipeGroup_IDgodeclare @a varchar(100)select @a=name from sysobjects where parent_obj=(select id from sysobjects where name='RecipeGroups') and x...
方法一exec sp_configure 'show advanced options',1reconfigureexec sp_configure 'xp_cmdshell',1reconfigureEXEC master..xp_cmdshell 'bcp "select * from ThunderERP.dbo.tempmembercardsinfo1" queryout c:\thunder\Sheet1.xls -c -q -S"127.0.0.1" -U"sa" -P""'g...
SQL Server数据库中使用sql脚本删除指定表的列 在SQL Server数据库中删除某一列,使用数据库管理工具直接可视化操作是很简单的,但是如果要用sql脚本呢?可能你会说很简单,直接用ALTER TABLE [要删除的字段所在的表名]DROP COLUMN [要删除的字段];GO这样不就OK了吗? 可是如果这个字段上要是有约束的话呢,就会弹出类似如下的提示:消息 5074,级别 16,状态 1,第 1 行对象'DF__***__***__682A18F4' 依赖于 列'***'。...
