Reputation
2,327
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
8 23
Newest
 Yearling
Impact
~148k people reached

Feb
5
awarded  Yearling
Jan
25
awarded  Popular Question
Dec
24
comment Does the order of columns in a table's definition matter?
Column order can matter in rare corner cases. For example, if you have a table with 3 columns A, B, and C, each 3kb bytes long. SQL Server pages are 8kb, so C doesn't fit, and goes into its own extended page. So select A, B from YourTable` requires only half the page reads of select A, C from YourTable.
Oct
22
comment Is it a bad practice to always create a transaction?
@BornToCode: Well spotted, you're right! on means the transaction will be left open!
Oct
19
awarded  Enlightened
Oct
19
awarded  Nice Answer
Oct
16
awarded  sql-server
Oct
9
comment Is it a bad practice to always create a transaction?
@ajbeaven: Yes, implicit transaction = on means that a commit will be run after every statement that is not in a transaction. off means that the transaction will be left open. But every statement will either start a transaction or be part of a transaction that was already open.
Sep
30
awarded  Popular Question
Sep
2
comment Sequence is reusing
FIX: Sequence object generates duplicate sequence values when SQL Server 2012 or SQL Server 2014 is under memory pressure Assume that you create a sequence object that has the CACHE option enabled in Microsoft SQL Server 2012 or SQL Server 2014. When the instance is under memory pressure, and multiple concurrent connections request sequence values from the same sequence object, duplicate sequence values may be generated. In addition, a unique or primary key (PK) violation error occurs when the duplicate sequence value is inserted into a table.
Aug
20
comment Is it poor practice to aggregate data from different tables into one?
Like you say, it is theoretically possible to make triggers work. It's just that in practice they never do.
Aug
14
revised Is it poor practice to aggregate data from different tables into one?
added 170 characters in body
Aug
14
answered Is it poor practice to aggregate data from different tables into one?
Aug
12
comment Can PostgreSQL use nulls in its indexes?
@FuriousFolder: You are describing an index-only scan. But the OP says that his indexes are not being used, which wouldn't happen if an index-only scan would satisfy the query.
Aug
11
answered Can PostgreSQL use nulls in its indexes?
Aug
4
awarded  Constituent
Jul
31
comment Stored procedure with recompile
Not sure what's wrong with with recompile. MSDN refers to it in the context of parameter sniffing: msdn.microsoft.com/en-us/library/ms190439.aspx It's not fine-grained or elegant but it gets the job done.
Jul
28
awarded  Caucus
Jul
18
comment How to validate column while creating Table?
Security is not the right way to defend yourself against developers. Write a script that periodically checks for non-conforming tables and emails the DBA's,
Jul
18
comment Restore a large number of transaction logs
+1 I can see why the use xp_cmdshell might lead to downvotes, but this sounds like exactly the time and place for quick & dirty :)