Viewing 15 posts - 511 through 525 (of 7,608 total)
DROP TABLE IF EXISTS #data;
CREATE TABLE #data ( trip_duration varchar(30) NOT NULL );
INSERT INTO #data VALUES
('23:01'), ('00:01'), ('05:15'), ('00:45'), ('00:11');
SELECT
...
March 2, 2023 at 3:17 pm
SELECT field, SUBSTRING(field, PATINDEX('%[2][0-9][0-9][0-9]%', field), 4) AS year
FROM #t March 1, 2023 at 2:53 pm
None that I'm aware of. It's actually an excellent place to store that type of info.
Just be sure you don't drop the table, or you'll lose all the ext props!
March 1, 2023 at 12:30 am
;WITH test_data AS (
SELECT 'A~B~C.ab' AS data
UNION ALL
SELECT 'D~E~FG.hij'
)
SELECT data, data_result
FROM test_data
CROSS APPLY (
...
March 1, 2023 at 12:19 am
You would also want to check what the FK DELETE options are on each table. For the ones that are CASCADE, that could cause updates in other tables as well...
February 28, 2023 at 3:15 pm
The way I figured it:
Currently you have 10 files * 100GB reserved = 1000GB.
If you drop each file to 85GB, you'll have 850GB reserved, i.e., 150GB less. On a drive...
February 23, 2023 at 9:34 pm
Shrink files 3 thru 8 to, say, 85GB. Then, wait a while. Once the tempdb file sizes get more balanced out, shrink files 1 and 2 back to 85GB. Ultimately...
February 23, 2023 at 9:09 pm
As for renaming the file, do not use detach; that's an obsolete method. Instead, issue an ALTER command to change the file name, take the database offline, rename the physical...
February 23, 2023 at 3:11 pm
Broadly speaking, SQL Server performance comes down to indexes (assuming you don't have major issues with RAM, disk I/O, other basics).
Therefore, first I'd suggest reviewing your indexes for performance. Unfortunately,...
February 22, 2023 at 7:57 pm
That code is not valid. There is no way to tell which 'type' column is being referenced in the WHERE clause.
February 22, 2023 at 2:48 pm
You have a some options at least to help speed things up. I'm sure someone can think of others. (Entries are numbered only to ease possible discussion of them, not...
February 20, 2023 at 8:55 pm
You're doing (the equivalent of) a CROSS JOIN on the WORKC and PLNT_WORKC tables (JOIN ON 1 = 1). That could generate a huge number of rows. You then filter...
February 16, 2023 at 6:56 pm
You don't need a temp table, you can just create a view of the existing table. The really good this is the view can be created using dynamic SQL, so...
February 16, 2023 at 3:58 pm
You can defer the ON clause for a JOIN until after other JOINs. Normally you wouldn't do that unless it's absolutely necessary.
LEFT OUTER JOIN TABLEC CC ON (CC.hFKey4 = CHG.hPKey...
February 14, 2023 at 6:36 pm
Thank you all!
Sorry but I made a mistake on my original posting. Revised DATA representation is below

IF OBJECT_ID('tempdb..#TestTable') IS NOT NULL
... February 13, 2023 at 9:55 pm
Viewing 15 posts - 511 through 525 (of 7,608 total)