摘要:
在SQL SERVER中,不要将变量和参数弄混淆了,即使他们的语法几乎相同: 1. 一个变量的值在一条SQL语句被真正执行之前永远是未知的,在编译时也是未知的。 2. 传递给存储过程的参数值在编译时是已知的,因为直到存储过程参数被赋值并且被真正调用,该存储过程才被编译和优化! 原文: Don't confuse variables with parameters even though the... 阅读全文
摘要:
The "Not For Replication" setting for identity columns allows replication to pass the ID value from the publisher to the subscriber without the subscriber creating a new ID. Since identity columns wi... 阅读全文
摘要:
原文出处:http://topic.csdn.net/t/20050602/13/4053922.html --测试环境,SQL Server2000,远程服务器名:xz,用户名为:sa,无密码,测试数据库:test --服务器上的表(查询分析器连接到服务器上创建) create table [user](id int primary key,num... 阅读全文
摘要:
原文出处:http://topic.csdn.net/t/20050602/13/4053922.html 测试环境及同步要求: 有数据库服务器srv1和srv2,两台电脑能互相访问,有数据 srv1.库名..author有字段:id,name,phone, srv2.库名..author有字段:id,name,telphone,adress ... 阅读全文
摘要:
例如:得到当前用户的query: DECLARE @Handle binary(20) SELECT @Handle = sql_handle FROM sys.sysprocesses WHERE spid = @@spidSELECT * FROM ::fn_get_sql(@Handle) go 阅读全文
摘要:
Please keep in mind that: "MOVE TO clause is only available with ALTER TABLE when you do a DROP CONSTRAINT". It is not available with ALTER TABLE on its own. The command will look like this: alte... 阅读全文
摘要:
--How to grant a user the access to create a table in a new schema use tempdb go create login u1 with password = 'Mdfjd$sakj943857l7sdfh##30' create user u1 with default_schema = u1 go grant crea... 阅读全文
摘要:
--引自《刘辉的博客:http://anywolfs.com/liuhui/article.asp?id=210》 Usage :: ROBOCOPY source destination [file [file]...] [options] 使用规则:robocopy 源目录 文件 参数 source :: Source Directory... 阅读全文
摘要:
if exists(select * from sys.objects where name like 'sp_waitfordbonline' and type ='P') drop procedure sp_waitfordbonlinego create procedure sp_waitfordbonline @dbname varchar(30), @timeout int as beg... 阅读全文
摘要:
C:"WINDOWS"Microsoft.NET"Framework"v2.0.50727>MSBuild.exe Microsoft (R) Build Engine Version 2.0.50727.832 [Microsoft .NET Framework, Version 2.0.50727.832] Copyright (C) Microsoft Corporation 2005.... 阅读全文