Viewing 15 posts - 2,701 through 2,715 (of 7,609 total)
Something else is going on, would need to see a more complete original statement and the table definition(s).
September 12, 2019 at 2:57 pm
Many companies have clients that have a credit limit: they can't order over a certain amount without prior approval. [I've worked in 2 such companies at least already.] That "remaining...
September 11, 2019 at 5:49 pm
You seem fixated on tying the physical format of data to its use/display. A value can be stored physically as an int without the value ever being directly used in...
September 10, 2019 at 10:35 pm
I've had the same bank account for more than 20 years. I'd hate to have to wait for them to compute a balance every time.
A balance is one of those...
September 10, 2019 at 8:48 pm
UPDATE dbo.table_name
SET balance = balance - @amount
WHERE balance - @amount >= 0.0
September 10, 2019 at 8:04 pm
a negative dollar amount followed by a non-negative dollar amount
Do you have something that can be sorted on to give the proper order of transactions? If so, it's easy to...
September 6, 2019 at 10:13 pm
You could consider using SQL's Change Tracking to keep track of the changes for you; you could then translate the tracking version into an actual datetime of change. And it's...
September 6, 2019 at 6:20 pm
Could you post the query plan, estimated is good enough for now, for this SQL:
delete lad from PA_LDG_HOLD_JRNAL_LINES_LAD lad inner join PA_LDG_JRNAL jrl on (lad.JRNAL_ID = jrl.HOLD_JRNAL_ID and lad.LINE_ID =...
September 5, 2019 at 3:45 pm
SELECT DateCol1, Col2,
STUFF(CASE WHEN [1] = 0 THEN ',1' ELSE '' END +
CASE WHEN [2]...
September 5, 2019 at 3:17 pm
NULL and 0.0 are not the same thing.
If you need the values to be 0.0, you should make sure they are INSERTed as 0. Use a default value and a...
September 4, 2019 at 6:26 pm
It's best to stop using INFORMATION_SCHEMA views. They can contain inaccuracies (on ownership) and are incomplete now.
Stick to sys.columns and the other MS standard views.
September 4, 2019 at 6:23 pm
I guessed you would want to sort/order by Item first; if not, you might want to reverse the GROUP BY to Name, Item.
SELECT Item, Name,
...
September 4, 2019 at 6:21 pm
The server has a database that is several hundred GB in size, so it's amazing that the server is even running at all.
Heh... while the world insists that...
September 4, 2019 at 6:15 pm
A bit tricky really, unless you want to take the 90 separate log files approach.
For example, if you set a job to cycle the log every 15 days, then the...
September 3, 2019 at 8:21 pm
I recommend one simplification to make your SQL coding and maintenance easier: use "*" in the inner query using ROW_NUMBER(). SQL will still only actually retrieve the data that is...
September 3, 2019 at 7:43 pm
Viewing 15 posts - 2,701 through 2,715 (of 7,609 total)