Viewing 15 posts - 451 through 465 (of 7,602 total)
SELECT Student_ID
FROM dbo.table_name
GROUP BY Student_ID
HAVING MAX(CASE WHEN Student_Status = '2' THEN 1 ELSE 0 END) = 1 AND
MAX(CASE WHEN Student_Status <> '2' THEN...
April 11, 2023 at 3:24 pm
If you're that worried about space, you could just a minutes displacement from Jan 01, 2023. So, midnight on that date would be 0. 2PM would be 14*60, etc.. Not...
April 11, 2023 at 2:19 pm
SELECT Student_ID
FROM dbo.table_name
GROUP BY Student_ID
HAVING MAX(CASE WHEN Student_Status = '2' THEN 1 ELSE 0 END) = 1 AND
MAX(CASE WHEN Student_Status <> '2' THEN 1 ELSE...
April 10, 2023 at 8:20 pm
Temp tables should work, but for best performance be sure to create a unique clustered index on the temp tables to aid in the subsequent joins. You'll want to create...
April 9, 2023 at 1:11 pm
From the nature of some of the code, it looks like all parameters are being passed as NVARCHAR(4000).
It doesn't matter how well code may be written, that generally means...
April 8, 2023 at 7:16 pm
Just to be safe, I would CAST the text to varchar(max). And, also, add code in case '</Node1>' is missing:
select
table1.Id,
substring(
ca1.source_data_varchar,
charindex('<Node1>',ca1.source_data_varchar) + 7,
nullif(charindex('</Node1>',ca1.source_data_varchar), 0) -...
April 5, 2023 at 2:17 pm
I put a space after the embedded forename (because of the wording of the OP: "who put in their middle name or surname with forenames separated by a space".)
Otherwise, I...
April 3, 2023 at 7:57 pm
You might avoid some false matches by using:
like '%' + p.forenames + ' %'
April 3, 2023 at 5:46 pm
But you should add the NULLability setting to the column. The default is somewhat obscure so you should always specify NULL or NOT NULL when adding a column.
April 3, 2023 at 2:17 pm
I've seen issues repeatedly with "SELECT ... INTO <new_table>" causing blocking (on SQL 2016). When we adjust the code to split the table creation...
April 2, 2023 at 3:45 am
/* dummy post to allow me to see my previous post */
April 1, 2023 at 9:49 pm
I've seen issues repeatedly with "SELECT ... INTO <new_table>" causing blocking (on SQL 2016). When we adjust the code to split the table creation and the...
April 1, 2023 at 9:10 pm
I've seen issues repeatedly with "SELECT ... INTO <new_table>" causing blocking (on SQL 2016). When we adjust the code to split the table creation and the table load...
April 1, 2023 at 8:41 pm
I've seen issues repeatedly with "SELECT ... INTO <new_table>" causing blocking (on SQL 2016). When we adjust the code to split the table creation and the table load...
April 1, 2023 at 8:35 pm
Derrick Smith (9/15/2010)
Jeff Moden (9/14/2010)
Derrick Smith (9/14/2010)
April 1, 2023 at 8:29 pm
Viewing 15 posts - 451 through 465 (of 7,602 total)