随笔分类 -  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 阅读全文
posted @ 2020-05-27 14:50 ChuckLu 阅读(229) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-05-27 14:35 ChuckLu 阅读(277) 评论(0) 推荐(0) 编辑
摘要:What is the difference between Clustered and Non-Clustered Indexes in SQL Server? Conclusion From the discussion we find following differences between 阅读全文
posted @ 2020-03-20 14:56 ChuckLu 阅读(136) 评论(0) 推荐(0) 编辑
摘要: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. 阅读全文
posted @ 2020-03-17 17:11 ChuckLu 阅读(2547) 评论(0) 推荐(0) 编辑
摘要:What is the difference between Shrink Database and File? Simply... DBCC ShrinkDatabase(): shrink all files DBCC ShrinkFile(): just one file For exampl 阅读全文
posted @ 2020-03-12 18:05 ChuckLu 阅读(165) 评论(0) 推荐(0) 编辑
摘要:Execution Plan Basics 阅读全文
posted @ 2020-01-14 09:53 ChuckLu 阅读(88) 评论(0) 推荐(0) 编辑
摘要:Identifying and Solving Index Scan Problems 阅读全文
posted @ 2020-01-14 09:52 ChuckLu 阅读(136) 评论(0) 推荐(0) 编辑
摘要:发现自带的,取消记住密码无效。 找到下面这个文件 C:\Users\clu\AppData\Roaming\Microsoft\SQL Server Management Studio\18.0\UserSettings.xml 找到<ServerConnectionSettings>结点,然后删除 阅读全文
posted @ 2020-01-07 10:18 ChuckLu 阅读(1190) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-11-02 14:55 ChuckLu 阅读(183) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-11-02 11:11 ChuckLu 阅读(154) 评论(0) 推荐(0) 编辑
摘要:https://segmentfault.com/q/1010000000251484 我的观点:这么设计的目的并不能方便随时修改业务逻辑,只是方便熟悉存储过程的开发人员,能够随时修改业务逻辑。对于后续的业务逻辑越趋于复杂,修改就越困难,存储过程中的重复代码就越多;重复代码越多,系统的坏味道就越散发 阅读全文
posted @ 2019-11-02 10:10 ChuckLu 阅读(1691) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-10-21 14:06 ChuckLu 阅读(179) 评论(0) 推荐(0) 编辑
摘要:尝试做分页处理 select row_number over (orderby id asc) as rownum,* from table where rownum>=(@page*@pagesize-@pagesize) and rownum<=(@page*pagesize) https:// 阅读全文
posted @ 2019-06-14 16:14 ChuckLu 阅读(504) 评论(0) 推荐(0) 编辑
摘要:https://stackoverflow.com/questions/53115490/how-to-correctly-insert-newline-in-nvarchar The problem is your setting on SSMS, not that the data doesn' 阅读全文
posted @ 2019-06-10 15:55 ChuckLu 阅读(1247) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-06-04 11:24 ChuckLu 阅读(514) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-05-27 16:40 ChuckLu 阅读(283) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-05-08 14:57 ChuckLu 阅读(409) 评论(0) 推荐(0) 编辑
摘要:遇到这个问题,是因为存储过程的参数,设置默认值写错了。 错误写法 @WhiteIp NVARCHAR(MAX) NULL, Stored procedure with default parameters I wrote with parameters that are predefined The 阅读全文
posted @ 2019-05-07 11:11 ChuckLu 阅读(553) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-05-06 17:43 ChuckLu 阅读(371) 评论(0) 推荐(0) 编辑
摘要:传递多个参数 https://stackoverflow.com/questions/28481189/exec-sp-executesql-with-multiple-parameters Here is a simple example: EXEC sp_executesql @sql, N'@ 阅读全文
posted @ 2019-04-22 10:02 ChuckLu 阅读(505) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示