Viewing 15 posts - 106 through 120 (of 2,648 total)
After rereading the original post I now understand about the INTERVAL_THICKNESS, this query works using a case statement to calculate the INTERVAL_THICKNESS
;WITH fn as
(
...
May 8, 2024 at 12:09 pm
However it looks like it is locking on the LITH1 of the 1 meter tally. I need somehow to instruct if there are multiple LITH1 rows within the meter,...
May 8, 2024 at 9:05 am
With this query:
;WITH fn as
(
select N
from dbo.fnTally(0, 300) fn
)
SELECT dd.PROJECT, dd.HOLE_ID, fn.N + 0.0 DEPTH_FROM,
...
May 7, 2024 at 4:12 pm
I'm not the OP. The UDF (dbo.fnTally) is a well know one by Jeff Moden and the OP is using this in his original post.
The...
May 7, 2024 at 3:59 pm
Thanks Phil. Interesting maybe. The real answer is don't use cursors 🙂
It's nothing to do with the cursor, it's how table variables work. Despite being declared within a block,...
May 7, 2024 at 3:36 pm
Not sure exactly what you want, but maybe something like this?
Create some data:
-- Creating the table
CREATE TABLE DrillingData (
PROJECT NVARCHAR(50),
...
May 7, 2024 at 3:20 pm
Not sure exactly what you want, but maybe something like this?
Create some data:
-- Creating the table
CREATE TABLE DrillingData (
PROJECT NVARCHAR(50),
...
May 7, 2024 at 1:58 pm
I'm not sure I quite understand, but maybe something like this:
INSERT INTO dbo.[table1] (ProductCode, ProductionDate, SerialNumber)
SELECT 'A' + RIGHT('00000' + CAST(CAST(RIGHT(MAX(ProductCode), 6) AS INT) + ROW_NUMBER() OVER...
April 24, 2024 at 4:57 pm
from ChatGPT
Query Explanation
Given Tables:
| Table1 | Table2 |
|---|---|
| A | B |
| B | C |
| C | D |
SELECT t1.name, t2.name
FROM Table1 t1
INNER JOIN Table2 t2
...
April 24, 2024 at 9:59 am
Have you got an example of the sort of data you'd like to insert?
April 24, 2024 at 9:54 am
You could import them all as nvarchar then try to work out where the error is.
You need to have the columns consistent throughout the entire file.
April 23, 2024 at 3:52 pm
If you want to find the query you could run something like this soon after the problem occurs.
DECLARE @Database sysname = 'Test'-- Specify your database
SELECT DB_NAME(qt.dbid) AS...
April 18, 2024 at 3:32 pm
Viewing 15 posts - 106 through 120 (of 2,648 total)