Viewing 15 posts - 46 through 60 (of 708 total)
Lets break this down into sets.
You are combining two sets of data from this table:
April 9, 2022 at 6:18 pm
DATEDIFF() returns an integer value. DATEADD() returns a date value. You can't subtract a date from a number. You can do decimal math on datetime values, though.
SELECT DATEDIFF(week, (GETDATE() -...
March 23, 2022 at 8:40 am
-- Note: the schema name is declared and used outside of dynamic SQL
CREATE TABLE [dbo].[ChannelReading_940860_11_34216228-4C4A-4137-AEA5-EFA9D6A88364_MainLevelData]
-- but the schema name is not declared or used in dynamic SQL
declare @MainLevelDataTableName NVARCHAR(200) =...
March 15, 2022 at 5:25 pm
You can use the OVER() clause with almost any aggregate function, not just windowed functions like ROW_NUMBER() and RANK().
That allows you to add in the column that SUM()s over a...
March 9, 2022 at 3:39 am
You have a list of all Orders that have at least one of three Items included.
You wish to exclude all Orders that have an Item that is not one of...
March 7, 2022 at 8:59 pm
If you were not capturing it at the time, then that data is lost.
But if you were performing object-level changes on tables, you would have blocking - those changes require...
March 7, 2022 at 3:49 am
Is there a way to setup the listener so that it will listen for SQL2\MyInstance?
It's not supported; the command to create a listener accepts a DNS name. That doesn't mean...
February 23, 2022 at 11:11 pm
1 – How can I not use self-sign cert in the TDE encryption. If I am following the below steps/ commands, then I will be using self-sign cert with my...
February 23, 2022 at 9:49 pm
SQL1 and SQL2 are presently identities in your domain. They have machine accounts and DNS entries. Creating a Listener with the same network name as another server on the network...
February 23, 2022 at 8:00 pm
First, you're using full paths to the nodes, even though you've shredded them with the .nodes method:
SELECT xed.event_data.value('(/RingBufferTarget/event/data/value)[1]', 'nvarchar(500)') AS value1,
xed.event_data.value('(/RingBufferTarget/event/data/value)[4]', 'nvarchar(500)') AS value4
FROM #capture_tls_data
CROSS APPLY targetdata.nodes('//RingBufferTarget/event/data') AS xed (event_data);
The...
February 17, 2022 at 11:27 pm
By default, what you're doing is not possible, because the way SQL Server performs encryption work changed in SQL Server 2017. You can work around this with a trace flag....
January 31, 2022 at 4:21 am
"My clients are web apps, and native mobile apps, goes via an APP server that talk to the DB"
You seem to understand it. The key point is that the value...
January 27, 2022 at 9:30 pm
The difference between Developer Edition and Enterprise Edition is basically limited to licensing and what words display with SELECT @@VERSION. Anything you can do with Developer Edition will work in...
January 27, 2022 at 7:02 pm
'19 Nov 2022' is converts to the datetime value of '19 Nov 2022 00:00:00.000', which is earlier (less than) '19 Nov 2022 15:19:12.000'.
Try:
WHERE [...]
AND CONVERT(date, TransferredDate) BETWEEN...
January 27, 2022 at 5:54 pm
This is known as a "Data Islands" problem - you're looking for groups of records in an ordered set.
You have a identity value on the table, so this gets easy....
January 19, 2022 at 4:45 pm
Viewing 15 posts - 46 through 60 (of 708 total)