SQL Server Management Studio连接服务器时指定端口号
今天想连接SQL Server服务器时发现没法连接,发现端口号不是默认的端口号,需要指定端口号,刚开始以为是IP地址加冒号再端口号就行了,结果发现没用,google一把发现原来不是冒号,是逗号,哈。比如:127.0.0.1,1451 , 格式就是:[IP],[Port] 。 完毕。
相关文档:
CONVERT
将某种数据类型的表达式显式转换为另一种数据类型。由于某些需求经常用到取日期格式的不同.现以下可在
SQL Server中 将日期格式化.
SQL Server 支持使用科威特算法的阿拉伯样式中的数据格式。
在表中,左侧的两列表示将 datetime 或 smalldatetime 转换为字符数据的 style 值。给 style 值加 100,可获得包 ......
Use DatabaseName
--DB shrink
--获取database 空余空间, 决定是否作shrinkDB
exec [DBNAME].dbo.sp_spaceused
DBCC ShrinkDB(DBNAME)
--Log file shrink
Use DatabaseName
GO
Alter Database DatabaseName Set Recovery Simple
GO
Alter Database DatabaseName Set Recovery Full
GO
DBCC SHRINKFILE ('Log ......
用sql操作oracle的blob字段
1、查询
select utl_raw.cast_to_varchar2(dlob),id from system.t_htinfo
2、插入
insert into system.t_htinfo values ('3',utl_raw.cast_to_raw('你'));
3、更新
update system.t_htinfo set fld_value=utl_raw.cast_to_raw('1') where fh_nm=1820648 and form_index=52
......
同一表多字段同时重复记录的SQL查询及处理数
比如现在有一人员表 (表名:peosons)
若想将姓名、身份证号、住址这三个字段完全相同的记录查询出来
select p1.* from persons p1,persons p2 where p1.idp2.id and p1.cardid = p2.cardid and p1.pname = p2.pname and p1.address ......
首先得下载驱动程序到微软网站下载Microsoft SQL Server 2005 JDBC Driver 1.2
解压Microsoft SQL Server 2005 jdbc driver1.2.exe,把sqljdbc_1.1复制到%ProgramFiles%(如果系统在C盘则为C:\Program Files)。
设置 Classpath
JDBC 驱动程序并未包含在 Java SDK 中。因此,如果要使用该驱动程序,必须将 classpath ......