Viewing 15 posts - 3,451 through 3,465 (of 7,614 total)
April 19, 2018 at 7:43 am
April 18, 2018 at 2:37 pm
Use CAST (it's ANSI-standard), and CAST the final result as well, if you want a specific size of result:
CAST( CAST( SUM(Principal1) AS DECIMAL(5,2) ) + CAST ( SUM(BankInterest) AS DECIMAL(5,2)...
April 18, 2018 at 11:42 am
April 18, 2018 at 11:32 am
See if this gives you what you need -- it should at least be very close. Btw, T-SQL isn't like C#, you don't need separate statements for every calc.
April 18, 2018 at 9:57 am
For that type of table definition, I'd suggest forcing all LOB columns completely out of the main table space (since SQL doesn't allow you to customize column-by-column). That should avoid...
April 18, 2018 at 9:27 am
I'd use CROSS APPLYs to determine the lengths (this helps keeps the other code "cleaner" by pushing calcs/computations into CROSS APPLYs). For example:
SELECT PCMRetrievalCode, LenOfSchemaId,...
April 18, 2018 at 9:17 am
I still don't understand why you need the index in string format to determine that. It's actually easier to accurately compare the meta-data rather than a string definition (where noncritical...
April 17, 2018 at 9:10 am
SELECT string, LEFT(string, split_byte - 1) AS string1,
SUBSTRING(string, split_byte + 1, 8000) AS string2
FROM (
VALUES('Apple is Red and Grapes are Purple'),
April 17, 2018 at 8:57 am
I'm going to label each q so others can comment without having to repeat the full q:
A1) transaction log back up verses a full back up?
A tran...
April 16, 2018 at 1:31 pm
April 13, 2018 at 12:56 pm
Would it result in better performance is I created the table and used INSERT instead of Select Into?
For that INSERT, no. In fact, SELECT ... INTO dbo.new_table...
April 13, 2018 at 12:52 pm
April 13, 2018 at 11:18 am
DECLARE @start_date date
DECLARE @end_date date
SET @start_date = DATEADD(YEAR, -1, GETDATE())
SET @end_date = GETDATE()
SELECT
AccountNumber,
CASE WHEN MAX(CASE WHEN row_num =...
April 13, 2018 at 8:46 am
Btw, just based on the pattern of code in your OP, it looks like you're doing a BETWEEN range on a datetime.
Put simply, DON'T do that, ever.
April 13, 2018 at 8:10 am
Viewing 15 posts - 3,451 through 3,465 (of 7,614 total)