Viewing 15 posts - 1 through 15 (of 3,482 total)
Oh that! LOL
Thanks Frederico!
Apologies to the OP, rcrock, for sorta hijacking his thread.
Here's the fixed code:
--desc: ugly search scans all string column types for a specific value
IF...
December 4, 2025 at 9:38 pm
??
I'm confused. I copied and pasted your code and tried to run it. It returns this error:
Msg 156, Level 15, State 1, Procedure sp_uglysearch, Line 84 [Batch Start Line 7]
Incorrect...
December 3, 2025 at 12:49 am
This is what I came up with... (btw... with that many points, you can't post CREATE TABLE etc statements for people?)
--CREATE TABLE LogTable (tableName NVARCHAR(50), columnName NVARCHAR(50));
--GO
--...
November 30, 2025 at 3:26 am
Sounds like you have serious design issues in your database. I don't envy you one bit.
But you can use a query like this to get all the column names and...
November 28, 2025 at 8:42 pm
I started reformatting the code... here's my reformat (FWIW):
SELECT
sa.partid AS ALLOC_Part,
sa.quantity,
sa.ordertype,
sa.worksorderid,
sa.reference,
sa.stockvalue,
apm.partdesc,
soi.orderid,
soi.itemnumber,
soi.partid AS SOI_Part,
so.traderid,
t.[name],
u.[name] As SalesRep,
MAX(sub.Max_Batchvalue) AS High_Batchvalue
FROM stockallocations sa
INNER JOIN worksorders wo ON
sa.worksorderid = wo.id
INNER JOIN allpartmaster...
November 24, 2025 at 3:36 pm
The most obvious thing is that you're using INNER joins everywhere. If you want to keep all the records from one table, you need to OUTER join from that to...
November 24, 2025 at 12:21 am
What happened when you tried it?
with only 15 records, I'm not sure you'll see a huge difference, but give it a try and record both times. I didn't write this...
November 8, 2025 at 4:35 pm
Generally speaking, if you can provide a clear question, some sample data (create table and insert scripts), and an expected output, you can ask all kinds of questions and get...
October 23, 2025 at 11:52 pm
Since you're new here... here's an article you owe it to yourself to read (it'll take like 2 minutes!)
Forum Etiquette: How to post data/code on a forum to get...
October 22, 2025 at 1:41 am
force it to NTEXT?
[ @stmt = ] N'statement'
A Unicode string that contains a Transact-SQL statement or batch. @stmt must be either a Unicode constant or a Unicode variable. More complex Unicode expressions, such as...
September 29, 2025 at 8:56 pm
clone the report and have the TOP 15 filter on one and not on the other? Just have a hyperlink in each to go to the other report
September 27, 2025 at 5:58 pm
Are you using your login credentials to run the SSIS packages? I think you need to use different accounts, otherwise, there's no way to tell the two apart.
September 21, 2025 at 4:51 am
It already "knows"... That's what SYSTEM_USER returns. For example...
SELECT SYSTEM_USER AS WindowsAccount, be.*
FROM Bakery.dbo.BakeEvents be;
I know, looks really stupid, but the first column is the user running...
September 20, 2025 at 8:28 pm
I can calculate the new unit cost or value or whatever... But do I store it in something like a stockTake table? Something like this?
CREATE TABLE [dbo].[StockTake](
[StockTakeID]...
September 13, 2025 at 2:37 am
In other words, a running total of Open + Created + Won + Lost
You could calculate them individually and then add... or...
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW?? (using a...
September 12, 2025 at 8:50 pm
Viewing 15 posts - 1 through 15 (of 3,482 total)