我经常看到两种样式,INSERT select和insert into select,有什么区别?它们是一样的吗?
我正在使用SQL Server 2008 Enterprise.
这是两个样本.
INSERT california_authors (au_id, au_lname, au_fname)
SELECT au_id, au_lname, au_fname
FROM authors
WHERE State = 'CA'
Run Code Online (Sandbox Code Playgroud)
http://www.sqlteam.com/article/using-select-to-insert-records
INSERT INTO Store_Information (store_name, Sales, Date)
SELECT store_name, Sales, Date
FROM Sales_Information
Run Code Online (Sandbox Code Playgroud)
http://www.1keydata.com/sql/sqlinsert.html
乔治,提前谢谢
我使用的是SQL Server 2008 Enterprise + C#+ ADO.Net + .Net 3.5.我正在使用sp_who2或sys.dm_exec_connections查找活动连接数(如果我找到有效连接数的方法错误,请告诉我).对于一些繁重的数据库消费者应用程序,我甚至可以找到活动连接数> 1000.
我想知道SQL Server的活动连接数是否有任何上限限制?
乔治,提前谢谢
当我尝试访问IIS 7.0中的网站(使用Windows Server 2008上的VSTS 2010 + .Net 4.0开发)中的页面(default.aspx)时,我遇到以下错误消息.有什么想法有什么不对?BadImageFormatException是什么意思?
顺便说一句:我运行Windows Server 2008 64位(不是R2)并且还没有激活Windows Server 2008,它可能是根本原因吗?
[BadImageFormatException: Could not load file or assembly 'test.foo' or one of its dependencies. Try to load bad formatted program. ] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192 System.Reflection.Assembly.Load(String assemblyString) +35 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +118 [ConfigurationErrorsException: …
如果我们使用汇编语言
mov eax, dword ptr[ebx]
Run Code Online (Sandbox Code Playgroud)
那么它意味着复制ebx指向的值(ebx包含地址值,而不是实际值,此指令复制地址中的实际值)?
如果我们使用
mov eax, dword ptr[some_variable]
Run Code Online (Sandbox Code Playgroud)
那么它意味着将变量"some_variable"本身的值复制到eax,而不是复制变量"some_variable"指向的值?
我的理解是否正确?
如果是,我很困惑为什么相同的汇编指令有两种不同的含义 - 在第一种情况下有一个间接级别,但在第二种情况下没有额外的间接级别.
任何意见?
编辑:
并非每个[]都没有产生任何影响,例如,指令xchg将采用一个方向的水平,这将加载edx指向的值.
整个源代码可以从中找到,
http://www.codeproject.com/KB/threads/spinlocks.aspx
#ifdef WIN32
inline int CPP_SpinLock::TestAndSet(int* targetAddress, int nValue)
{
__asm {
mov edx, dword ptr [pTargetAddress]
mov eax, nValue
lock xchg eax, dword ptr [edx]
}
}
#endif // WIN32
Run Code Online (Sandbox Code Playgroud) 我正在使用VSTS 2008 + C#+ .Net 3.5 + SQL Server 2008 + ADO.Net.如果我使用ADO.Net的DataTable从数据库加载表,并在数据库表中,我在表上定义了几个索引.我的问题是,是否在ADO.Net DataTable上,有相关索引(与我在物理数据库表上创建的索引相同)来提高DataTable的某些操作性能?
乔治,提前谢谢
我想在独占模式下打开一个文件进行读取,如果某个进程/线程已经打开了该文件,我想收到一个异常.我尝试了下面的代码,但没有工作,即使我打开了foo.txt,我仍然可以访问Console.WriteLine语句.有任何想法吗?
static void Main(string[] args)
{
using (Stream iStream = File.Open("c:\\software\\code.txt", FileMode.Open,
FileAccess.Read, FileShare.None))
{
Console.WriteLine ("I am here");
}
return;
}
Run Code Online (Sandbox Code Playgroud) 当我们定义外键约束时,我对SQL Server 2008 Management Studio中更新和删除规则的含义感到困惑.我也没有找到相关的帮助文档(例如F1帮助).
这是屏幕快照.感谢是否有人可以描述他们的意思并推荐一些相关的文件来阅读.:-)
当我使用VSTS调试器来查看类实例的属性时Process
,许多属性都标有InvalidOperationException
.为什么?我做错了吗?
我正在使用VSTS 2008 + C#+ .Net 2.0来开发控制台应用程序.
这是我的代码:
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "IExplore.exe";
myProcess.StartInfo.Arguments = @"www.google.com";
myProcess.StartInfo.Verb = "runas";
myProcess.Start();
Run Code Online (Sandbox Code Playgroud)
以及调试器的屏幕截图:
.net c# process invalidoperationexception visual-studio-2008
我很惊讶地看到HttpWebRequest
没有紧密的方法,但它的反对部分HttpWebResponse
有.这让我有点困惑和不方便.:-)
那么,我们只需要在响应时调用Close,而不需要处理请求?我担心的是泄漏和更好的资源使用效率.我使用的是VSTS2008 + C#+ .Net 3.5.
我正在使用SQL Server 2008 Enterprise.我正在使用链接服务器技术从另一台服务器链接另一个SQL Server 2008 Enterprise实例.我编写TSQL来处理来自两个服务器实例的对象(例如表).
我的问题是,对于链接服务器,是否存在很大的性能问题?如果是,我们应遵循的关键性能瓶颈和最佳实践是什么?
乔治,提前谢谢