随笔分类 - SQLServer
摘要:Subquery using Exists 1 or Exists * 回答1 No, SQL Server is smart and knows it is being used for an EXISTS, and returns NO DATA to the system. Quoth Mic
阅读全文
摘要:NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: SQL Server NOT IN ? 1 2 3 4 5 6 7 SELECT l.id, l.value FROM [20090915_anti].t_left l WHERE l.value NOT
阅读全文
摘要:What is the difference between Clustered and Non-Clustered Indexes in SQL Server? Conclusion From the discussion we find following differences between
阅读全文
摘要:https://blog.csdn.net/cassiel33/article/details/9187767 https://bbs.csdn.net/topics/390908213 select a.id,a.数量 - b.数量 from abc a left join abc b on a.
阅读全文
摘要:What is the difference between Shrink Database and File? Simply... DBCC ShrinkDatabase(): shrink all files DBCC ShrinkFile(): just one file For exampl
阅读全文
摘要:Execution Plan Basics
阅读全文
摘要:Identifying and Solving Index Scan Problems
阅读全文
摘要:发现自带的,取消记住密码无效。 找到下面这个文件 C:\Users\clu\AppData\Roaming\Microsoft\SQL Server Management Studio\18.0\UserSettings.xml 找到<ServerConnectionSettings>结点,然后删除
阅读全文
摘要:DATEADD (Transact-SQL) This function adds a specified number value (as a signed integer) to a specified datepart of an input date value, and then retu
阅读全文
摘要:how does SELECT TOP works when no order by is specified? There is no guarantee which two rows you get. It will just be the first two retrieved from th
阅读全文
摘要:https://segmentfault.com/q/1010000000251484 我的观点:这么设计的目的并不能方便随时修改业务逻辑,只是方便熟悉存储过程的开发人员,能够随时修改业务逻辑。对于后续的业务逻辑越趋于复杂,修改就越困难,存储过程中的重复代码就越多;重复代码越多,系统的坏味道就越散发
阅读全文
摘要:comparison of truncate vs delete in mysql/sqlserver [duplicate] DELETE DELETE is a DML Command. DELETE statement is executed using a row lock, each ro
阅读全文
摘要:尝试做分页处理 select row_number over (orderby id asc) as rownum,* from table where rownum>=(@page*@pagesize-@pagesize) and rownum<=(@page*pagesize) https://
阅读全文
摘要:https://stackoverflow.com/questions/53115490/how-to-correctly-insert-newline-in-nvarchar The problem is your setting on SSMS, not that the data doesn'
阅读全文
摘要:https://support.microsoft.com/en-my/help/956176/error-message-when-you-try-to-save-a-table-in-sql-server-saving-change In the Options dialog box, clic
阅读全文
摘要:https://stackoverflow.com/questions/12422986/sql-query-to-get-the-deadlocks-in-sql-server-2008 You can use a deadlock graph and gather the information
阅读全文
摘要:how to get the next autoincrement value in sql 回答1 To get the next auto-increment value from SQLServer : This will fetch the present auto-increment va
阅读全文
摘要:遇到这个问题,是因为存储过程的参数,设置默认值写错了。 错误写法 @WhiteIp NVARCHAR(MAX) NULL, Stored procedure with default parameters I wrote with parameters that are predefined The
阅读全文
摘要:What size do you use for varchar(MAX) in your parameter declaration? In this case you use -1. See also MSDN docs: msdn.microsoft.com/en-us/library/bb3
阅读全文
摘要:传递多个参数 https://stackoverflow.com/questions/28481189/exec-sp-executesql-with-multiple-parameters Here is a simple example: EXEC sp_executesql @sql, N'@
阅读全文