Viewing 15 posts - 526 through 540 (of 754 total)
This seems like a non-normalized design. Is there a relationship between categoryc & categoryx in the same row? What is it?
If not (and probably even if there is), use a...
February 1, 2022 at 3:25 pm
"OR" is good choice in this scenario, & conveys intent clearly. You could try unioning two separate selects, w/ test_ID in the where clause of one, & oldsome_cust_ID in the...
January 31, 2022 at 11:34 pm
Yes, OUTPUT is the way you would handle multiple rows.
But that procedure, as written, will never insert more than one row. It is using individual parameters correlating to columns, not...
January 31, 2022 at 11:08 pm
Since sp_InsertCasesintoCallLog is only inserting one row at a time, you can just use SCOPE_IDENTITY() to get the inserted RecID, and then use that in the where clause for the...
January 31, 2022 at 10:51 pm
text datatype is deprecated -- don't use it.
Cast as varchar(11) instead (11 is maximum # of characters in a negative int).
January 28, 2022 at 5:56 pm
You don't set query timeout in a stored procedure/TSQL. Query timeout is a client setting. You were on the right track w/ CommandTimeout.
It's not clear what you meant by "did...
January 24, 2022 at 2:16 pm
Ideally, one plans for how valid they need/want the data to be vs. how much they're willing to pay to achieve that. e.g., if we must have valid addresses, then...
January 21, 2022 at 2:12 pm
SQL Server does not use double pipes ("||") for concatenation --it uses the plus ("+") sign.
SQL Server 2012 introduced the CONCAT function as another alternative for concatenating strings. One...
January 20, 2022 at 9:16 pm
In the ATM case, the customer details you described belong to the customer's bank. As Scott described, the ATM transaction details are quite narrow. There are APIs/protocols that allow the...
January 20, 2022 at 7:01 pm
It's not. Everything just inserted or updated is in the virtual "inserted" table, so the join adds no value.
Good observation.
January 20, 2022 at 4:58 pm
It certainly can. It sounds like the update took a table lock on table_a to handle the big update.
January 19, 2022 at 3:38 pm
No, a select doesn't insert, delete, or update data.
January 18, 2022 at 8:37 pm
What is the error?
I'd guess it's related to not having aliased the subquery -- e.g.,
Declare @CopyFromUser Varchar(10) = (Select Top 1 * from
...
January 18, 2022 at 8:33 pm
Be careful of leap years.
Using 365 days could give a different result than using 12 months or 1 year in a leap year -- specifically on February 29th. Using month...
January 18, 2022 at 6:19 pm
Viewing 15 posts - 526 through 540 (of 754 total)