Viewing 15 posts - 16 through 30 (of 482 total)
If you have space on prod, restore it to second DB on prod server, remove unneeded tables/content, then back that up and restore to dev.
July 9, 2021 at 3:07 pm
Thank you all.
This was a purely educational matter.
I share your concerns re: cursors and dynamic SQL, but sometimes there is no other way.
At any rate, this report will likely run...
June 15, 2021 at 11:12 am
I could have been clearer: the logical reads are on the target of the INSERT.
It's an INSERT #Action/EXECUTE dbo.sp_executeSQL, inside a cursor. Could it be because it's dynamic SQL?
I SET...
June 14, 2021 at 4:54 pm
I need to call the sprocs with named parameters, so I ended up just building a command in the cursor declaration.
I think there was always going to be some hard-code,...
April 30, 2021 at 1:30 pm
So I'm running a bunch of reports through a cursor. Different DBs, different subsets of the same list of reports.
A couple of the reports have additional parameters. I was hoping...
April 29, 2021 at 6:52 pm
Thanks for the succinct reply 🙂
For that matter, is there a way to even list the variables in the current scope?
April 29, 2021 at 6:17 pm
Yup, that does it. I'd distilled Johan's solution down to yours. Perf not completely horrible in real life, and I only need to run this once a month.
Thank you both.
April 8, 2021 at 1:24 pm
Hmmm... my OP had appeared to time-out without posting, which is why I reposted the question.
The solution was to restart the SQL Server service.
January 25, 2021 at 11:44 am
...and then restart the server. D'oh!!
Skipped right over that line in BOL
January 19, 2021 at 7:25 pm
The .Net directory searcher and PoSh is the way to go. The AD cmdlets and the QAD cmdlets (Qwest AD - or OneIdentity now, as mentioned in one of the...
July 20, 2020 at 11:52 am
Since all operations inside the loop are in a single DB, USE @db_name makes the code a lot easier on the eyes.
SET NOCOUNT ON, only to print out a custom...
June 26, 2020 at 10:35 am
scdecade,
Trust me. this works to eliminate the DBs where the table to be updated doesn't exist from the cursor that is supplying the @db_name.
SELECT Name FROM sys.databases
WHERE OBJECT_ID(Name + '.dbo.<tablename>')...
June 25, 2020 at 8:07 pm
Declare @msg varchar(100)
DECLARE db_cursor CURSOR FOR
SELECT Name FROM Alldatabases
WHERE OBJECT_ID(Name + 'dbo.<tablename>') IS NOT NULL
ORDER BY Name
OPEN wh_cursor
In your post, you had 2 tables, Settings and Employee, so maybe you...
June 25, 2020 at 1:45 pm
Wow. So simple now.
Still labouring in 2008, our next version is supposed to be 2016, with no set date for that.
I figure I'll be able to start using STRING_AGG sometime...
June 17, 2020 at 7:51 pm
You say "occasional" errors. For me, this would go into a separate table with a FK to the main table, the error, and the emailed status (and date?)
June 9, 2020 at 10:33 am
Viewing 15 posts - 16 through 30 (of 482 total)