Viewing 15 posts - 931 through 945 (of 7,614 total)
I'd urge you not to write a query based only on current data, but to make it more flexible:
--
insert into #tbl_backup_path values ('\\x.x.x.x\Database_Backup_Daily\ServerName$SQLEXPRESS\DB_5\DIFF\ServerName$SQLEXPRESS_DB_4_FULL_20220327_091554.diff')
SELECT backup_path, LEFT(backup_path, LEN(backup_path) -...
April 4, 2022 at 2:31 pm
Where does the data type int come from?
//Naper72
It comes from the "ELSE 0", as ratbak implied. The "0" by itself is a numeric. Use "'0'" instead.
April 4, 2022 at 2:25 pm
Btw, I think it would be better if you used a separate column for the string message to keep the diff column as only numeric, but that's just IMO.
April 4, 2022 at 2:22 pm
(1) You need to verify that the 3 values are unique on at least one table; otherwise you will get the equivalent of a CROSS JOIN for all non-unique groups. ...
April 4, 2022 at 2:03 pm
If you do not need full-text indexing nor filestream data on the reporting db, you could consider using a db snapshot as "DB2". The initial create of the snapshot is...
March 31, 2022 at 2:07 pm
In an earlier post, Scott suggested to add BEGIN TRANSACTIONS and COMMIT TRANSACTIONS. As expected this only makes the procedure run much slower.
I suggested to add them to BLOCKS...
March 31, 2022 at 1:45 pm
I agree that you'd most likely be better off using a single UPDATE for specific conditions whenever possible.
However, if that's not feasible at this time, other possibilites are:
(1) Add BEGIN...
March 29, 2022 at 6:23 pm
Not sure what you mean. It did remove 'rtf' from the string. What more, specifically, do you want it to do?
March 28, 2022 at 8:14 pm
As to putting FKs on an audit table... don't EVER do that. There's not reason to because the rows have already survived the INSERTs and UPDATEs for FKs...
March 28, 2022 at 8:07 pm
If they're still too incompetent to do it, hopefully they (1) realize that and get help (2) you realize that and get rid of them if they just...
March 28, 2022 at 6:38 pm
That is a classic supertype/subtyte setup. (Similar to sys.objects being a supertype in SQL Server to subtypes of table, procedure, etc.)
But you're missing the "supertype" table. That is, you should...
March 28, 2022 at 6:32 pm
As to putting FKs on an audit table... don't EVER do that. There's not reason to because the rows have already survived the INSERTs and UPDATEs for FKs and FKs...
March 28, 2022 at 5:44 pm
Rather than just going back to the first step, I would go to a later, isolated step in the job, and ultimately that step would go back to the first...
March 28, 2022 at 5:33 pm
Since you're only checking for an hour range, you can use BETWEEN. It's just as accurate and easier to code and read.
I agree that it's real tempting to...
March 25, 2022 at 8:27 pm
Viewing 15 posts - 931 through 945 (of 7,614 total)