Viewing 15 posts - 76 through 90 (of 4,080 total)
The query below will produce the combined results of your four queries. However, I think it would be more meaningful if you also included the TYPE and the ORIGINE...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 25, 2019 at 8:29 pm
Might be worthwhile to first query the commodities table and put the results into a #temp table indexed on commodityID, then join to the #temp table. Depends on how many...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 15, 2019 at 8:26 pm
Sorry for being gone so long, regretfully I was in the hospital. Apologies. Sadly, I worked with all this years ago and have given away all my books. ...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 15, 2019 at 7:58 pm
Can you direct the output from the SQLCMD script to a text file, then open it using OpenRowset??
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 15, 2019 at 7:53 pm
Are there no SYBASE forums? 😉
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 15, 2019 at 7:48 pm
You didn't specify a length of the strings you wanted. This illustrates finding repeats from 1 to 4 strings long. The LEAD() function allows the query to look 1...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 15, 2019 at 5:44 pm
Assuming you are talking about SELECT statements, it really depends on the amount of data being retrieved. But usually anything running for three minutes is NOT running efficiently. ...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 15, 2019 at 4:57 pm
You're welcome. And I admire Drew's solution. Just couldn't dredge one as elegant up.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 15, 2019 at 4:46 pm
bmg0002:
Just to clarify, I am not advocating a unique int (or bigint) column simply as a row identifier. It would become the primary key which all foreign keys would refer...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 15, 2019 at 4:42 pm
What you are showing in your example isn't a true rank. Essentially it is just grouping similar status codes, incrementing an integer each time the status code changes. You...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 14, 2019 at 9:41 pm
Even if an table is fairly wide, applications can always run against covering indexes and indexed views. The key question is whether the data from the first file has to...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 14, 2019 at 8:05 pm
An existence test and a TOP 1 both stop as soon as they find a row that satisfies the WHERE conditions. Run the following code. Although execution plans...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 14, 2019 at 6:34 pm
A function cannot do an UPDATE. But for just retrieving data, I agree with the cross apply approach.
What Jeff and others are trying to explain is that if your...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 14, 2019 at 6:04 pm
Row locks run slower than page locks, which are the default locks used by SQL Server. (https://littlekendra.com/2016/02/04/why-rowlock-hints-can-make-queries-slower-and-blocking-worse-in-sql-server/) I'm not sure what you think Rowlock will buy you.
Merges run best...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 14, 2019 at 5:22 pm
I"m going to weigh in on the side of artificial keys. I have wavered on this issue for a long time, but what ultimately convinced me was the annoying...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
November 14, 2019 at 5:11 pm
Viewing 15 posts - 76 through 90 (of 4,080 total)