清除SQL Server Management Studio最近服务器列表
摘自:伊仪秋水
SQL Server Management Studio (SSMS) 的“连接到服务器”对话框会记录用户所有访问过的服务器名称,这个功能对于经常连接多个数据库的人来说确实挺方便的。
不过使用了一段时间之后,这个列表会变得很长。里面还有很多服务器名称都已经失效了,很想把这个列表清空了。但是很郁闷在SSMS的界面找不到可以清空该列表的地方,于是我Google了一把,找到了答案。
对于 SQL Server 2005 Management Studio,可以删除以下文件清空该列表:
WinXP: C:\Documents and Settings\<user>\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat
Vista/Win7: C:\Users\<user>\AppData\Roaming\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat
对于 SQL Server 2008 Management Studio,可以删除以下文件清空该列表:
WinXP: C:\Documents and Settings\<user>\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
Vista/Win7: C:\Users\<user>\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
相关文档:
通常情况下,SQL Server里面的生成SQL脚本,只会包含数据库及表的字段结构,而不会包含表的数据,也就是SQL脚本里面只有Create database,Create table 这样的语句,没有insert into。
因为SQL Server并不包含这个功能,只能靠第三方的代码了。
以下存储过程可以实现:
CREATE PROCEDURE dbo.UspOutputData
@tablenam ......
原贴:http://topic.csdn.net/u/20100412/11/a4ea520e-7dd0-44d2-98bb-9f62f0ed6160.html?21233
--------------------------------------------------------------------------
-- Author : htl258(Tony)
-- Date : 2010-04-14 06:02:36
-- Version:Microsoft SQL Server 2008 (RTM) - 1 ......
SQL取日期
SQL Server 2009-11-19 15:07:30 阅读7 评论0 字号:大中小
方法一:
select CONVERT(varchar, getdate(), 120 )
2004-09-12 11:06:08
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),\'-\',\'\'),\' \',\'\'),\':\',\'\')
20040912110608
select CONVERT(varchar(12) , getdate( ......
先开启服务器配置选项:
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE
/** 导出文本文件
EXEC master..xp_cmdshell 'bcp dbname..tablename out c:\DT.txt -c -S servername -U sa -P password'
或
EXEC master..xp_cmdshell ' ......
for i=0,i++,i<@num
select dateadd(DAY,GETDATE(),I)
请问上面的语句怎么改写才正确???
Transact-SQL 参考
WHILE
设置重复执行 SQL 语句或语句块的条件。只要指定的条件为真,就重复执行语句。可以使用 BREAK 和 CONTINUE 关键字在循环内部控制 WHILE 循环中语句的执行。
语法
WHILE Boolean_expression
{ s ......