Viewing 15 posts - 766 through 780 (of 7,616 total)
ok, that's not what I thought you meant. I thought you meant flip all the bits.
This works for 0 and 1:
DECLARE @smallint smallint =...
July 5, 2022 at 11:09 pm
I'm trying to think of a more efficient way, but for now this should at least function correctly:
;WITH cte_add_row_num AS (
SELECT *, ROW_NUMBER()...
July 5, 2022 at 11:07 pm
What are the datatypes for the two columns in Question #1?
smallint and char(3) (and I have added the data types to the original post).
July 5, 2022 at 10:35 pm
ok, that's not what I thought you meant. I thought you meant flip all the bits.
This works for 0 and 1:
DECLARE @smallint smallint = 0
select @smallint...
July 5, 2022 at 10:25 pm
The expectation, as in the OP, is that 0 becomes 1 and 1 becomes 0. I didn't really mention -1; typically values are 0/1 for no/yes.
DECLARE @int...
July 5, 2022 at 9:55 pm
1
SELECT t.*
FROM MyTable t
CROSS APPLY (VALUES ('Jan', 1),('Feb', 2),('Mar', 3),('Apr', 4),('May', 5),('Jun', 6),('Jul', 7),('Aug', 8),('Sep', 9),('Oct', 10),('Nov', 11),('Dec', 12)) M(Name,N)
...
July 5, 2022 at 9:41 pm
1
SELECT t.*
FROM MyTable t
CROSS APPLY (VALUES ('Jan', 1),('Feb', 2),('Mar', 3),('Apr', 4),('May', 5),('Jun', 6),('Jul', 7),('Aug', 8),('Sep', 9),('Oct', 10),('Nov', 11),('Dec', 12)) M(Name,N)
...
July 5, 2022 at 9:40 pm
1
SELECT t.*
FROM MyTable t
CROSS APPLY (VALUES ('Jan', 1),('Feb', 2),('Mar', 3),('Apr', 4),('May', 5),('Jun', 6),('Jul', 7),('Aug', 8),('Sep', 9),('Oct', 10),('Nov', 11),('Dec', 12)) M(Name,N)
...
July 5, 2022 at 8:56 pm
The table would need to contain, and be keyed on, workerID, year and Course_Code. This should be a unique key if that is your rule (that is, no single worker...
July 5, 2022 at 7:06 pm
Consider, for example, with design #1, a unique constraint will insure that the same course is not entered twice for the same year.
But for design #2, you'd have to insure...
July 5, 2022 at 2:02 pm
You should only ever use the first method, period, no matter what your current requirements are.
The second approach would be a maintenance and query nightmare.
July 5, 2022 at 1:14 pm
You don't need to do point-in-time recovery if you take a differential at the exact point you want to restore to, just like with a full backup (which was OP's...
July 4, 2022 at 5:44 pm
Perhaps you could take a differential backup instead of a log backup. That would not interfere with any other backup process (and you wouldn't have to apply any tran logs...
July 1, 2022 at 7:46 pm
I've been a DBA on SQL Server for 20+ years and only for certain vendors have I ever had to go thru permission by permission. I have to admit, for...
July 1, 2022 at 7:38 pm
NOTE: I modified the quote to use numbers (rather than generic bullets) to make discussing each one easier.
(1) How long will the update process take to update that...
July 1, 2022 at 3:34 pm
Viewing 15 posts - 766 through 780 (of 7,616 total)