Viewing 15 posts - 4,171 through 4,185 (of 7,597 total)
INSERT INTO dbo.TableA
( Sequence, Title, Signature, IsDefault, UserName )
SELECT A_Last.Sequence + B.row_num, A.Title, A.Signature, 'Y' AS IsDefault, B.UserName
FROM (
SELECT B2.*, ROW_NUMBER() OVER(ORDER BY B2.UserName) AS row_num
...
August 25, 2016 at 9:44 am
GilaMonster (8/24/2016)
Your...
August 24, 2016 at 2:14 pm
Afaik, there is no way to get that number back from SQL. In theory, SQL could have had to cascade thru a dozen tables (or more).
August 19, 2016 at 1:24 pm
I give up. You keep randomly changing things. And this message:
"The variable name '%.*ls' has already been declared. Variable names must be unique within a query batch or...
August 19, 2016 at 9:34 am
SET @SQLstmt =
N'DECLARE @RCount int ' +
' SELECT [LCPRBSELF]' +
' FROM [' + @rowDSServer+ ']' + '.'
+ '['...
August 19, 2016 at 8:16 am
DOH, sorry, typo on my part. Should be:
values('DP'),('SP')
[rather than values('DP','SP')]
Edit: added bold to the parens I added to highlight them better.
August 19, 2016 at 8:09 am
Floating point values are only approximate values rather than exact values. If you need to make an equals comparison, you need to use decimal values.
August 18, 2016 at 4:13 pm
Your variable in the code is named @Rcount. You need to use that name in the @params clause:
EXEC sys.sp_executesql @stmt = @SQLstmt
, @params = N'@Rcount INT OUTPUT'
August 18, 2016 at 11:33 am
select MBR_LAST_NAME, MBR_FIRST_NAME, BIRTH_DT, SERVICE_DT,
SERVICE_TYPE_CD, case when SERVICE_TYPE_CD = 'DP' then DP ELSE SP END AS BLOOD_PRESSURE
from (
select MBR_LAST_NAME, MBR_FIRST_NAME, BIRTH_DT, SERVICE_DT,...
August 18, 2016 at 8:52 am
select MBR_LAST_NAME, MBR_FIRST_NAME, BIRTH_DT, SERVICE_DT,
MAX(case when SERVICE_TYPE_CD = 'DP' then <value> end) AS DP,
MAX(case when SERVICE_TYPE_CD = 'SP' then <value> end)...
August 17, 2016 at 4:16 pm
Those are excellent points. Thus, the other rule you should follow when creating indexes is to always explicitly specify CLUSTERED or NONCLUSTERED. Again, clustering is far too critical...
August 17, 2016 at 2:55 pm
To avoid pulling the entire remote table columns over every time the query runs, you need to add an index to the remote table that will identify rows updated or...
August 17, 2016 at 1:55 pm
1) No. The primary key and clustering key are not necessarily directly related. The clustering index is the single most critical factor for performance. And it should...
August 17, 2016 at 1:49 pm
Ed Wagner (8/17/2016)
Jeff Moden (8/17/2016)
ScottPletcher (8/17/2016)
Again, auditors would not have access to the original table.
But they have direct access to the audit table? That doesn't make sense to me...
August 17, 2016 at 12:37 pm
Viewing 15 posts - 4,171 through 4,185 (of 7,597 total)