Viewing 15 posts - 2,536 through 2,550 (of 7,609 total)
SQL can't execute the query as you've written it because there may be multiple values of T1.LineNUM for a given combination of DocEntry and ChapterID.
For example, suppose these two rows...
January 13, 2020 at 10:19 pm
You need to use sp_executesql rather than just exec(), because sp_exec allows value(s) to be returned:
DECLARE @SQLSTR nvarchar(500)
DECLARE @DELCOUNT int
...
SET @SQLSTR = 'Set IDENTITY_INSERT Table_2 ON;DELETE from...
January 13, 2020 at 6:52 pm
I think the code below is much simpler. The code is complete, no function needed. And, yes, I took a short-cut, so, yes, this code will fail for 2100. If...
January 13, 2020 at 6:37 pm
Just want to clarify here Scott, who's the idiot you are having difficulties with?
That q obviously makes it self-evident.
Accounting entries are not properly classified simply by a + or...
January 9, 2020 at 8:39 pm
So can you do this or can't you? The ONLY question you have to ask, is if the OP's design allows negative numbers. If the OP NEEDS...
January 9, 2020 at 8:36 pm
SELECT OBJECT_NAME(c.object_id) AS TableName
FROM sys.columns c
INNER JOIN sys.tables t ON t.object_id = c.object_id
WHERE c.name IN ('Column1','Column2','Column3')
GROUP BY c.object_id
HAVING COUNT(*) = 3
ORDER BY TableName
January 9, 2020 at 5:33 pm
I defy you to produce a proper Balance Sheet without distinguishing between debits and credits. Show me how that would be done.
I gotta go with Joe on this. The...
January 9, 2020 at 3:39 pm
The slight extra space is to store the upper level(s) (root level and intermediate level(s)) of the index, which are the b-tree structure that allows quick searches to specific row...
January 8, 2020 at 5:07 pm
SELECT ClientID
FROM #Projects
GROUP BY ClientID
HAVING COUNT(DISTINCT ClientRole) > 1
ORDER BY ClientID
January 8, 2020 at 2:43 pm
I prefer using CROSS APPLY to assign alias names. CAs can also cascade, where one alias can be used to create another alias(es). That's very helpful sometimes.
select BSEG_ID,SP_ID,FINAL_REG_QTY,START_REG_READING, END_REG_READING,
ActualRead
from CI_BSEG_READ
cross...
January 8, 2020 at 2:39 pm
.1. The PK itself.
.2. No.
.3. The clustering key column(s) are stored in higher-level index entries. The deeper the index depth, the more space the upper levels of the index take.
January 7, 2020 at 8:21 pm
jcelko212 32090 wrote:>> I don't think I was particularly snarky.
THAT, good Sir, is the crux of the problem. 😉
I don't think his first post was particularly snarky, esp. for him,...
January 7, 2020 at 7:41 pm
My next correction is a little more controversial. The reason that debits and credits exist has to do with the fact that when modern bookkeeping began in the Renaissance,...
January 7, 2020 at 5:48 pm
I left one out, the sample INNER JOIN:
;WITH cte_A AS ( SELECT * FROM (VALUES(1, 'A', 10),(2, 'B', 20), (3, 'C', 30)) AS data(key_col, col1, col2)
), cte_B...
January 3, 2020 at 3:58 pm
Viewing 15 posts - 2,536 through 2,550 (of 7,609 total)