Reply To: Insert using table unput
SQLServerCentral Forum
by Bruin
55m ago
I tried this but it didn't delete record DECLARE @Counter INT = 1;DECLARE @MaxCount INT = 1; -- Set this to the number of times you want to run the insertDECLARE @SQLString NVARCHAR(MAX);DECLARE @ParmDefinition NVARCHAR(MAX);WHILE @Counter <= @MaxCountBEGIN -- Construct the SQL command SET @SQLString = N'select sqlToExec from sv1.cb.dbo.crtDelete where ID =1'; -- Execute the SQL command EXECUTE sp_executesql @SQLString -- Increment the counter SET @Counter = @Counter + 1;END ..read more
Visit website
Reply To: Degraded Performance in 2017 vs 2008 R2 with inserts
SQLServerCentral Forum
by MichaelT
2h ago
Thank you! We'll look into those settings. Just out of curiosity, if the machines are identical in terms of all specs with more RAM for the SQL 2017 should we be expecting performance improvements? Essentially, is SQL 2017 generally faster in normal CRUD operations out-of-the-box than SQL 2008 R2?  I'd expect improvements but that could just be a false expectation on my behalf ..read more
Visit website
Table Partitioning - remove null range
SQLServerCentral Forum
by goher2000
2h ago
hi guys,   I have a partitioned table AM_ITM_INSTNC_MSS and I want to  get rid of MYDW_TPData2015 filegroup, how can I achieve that ..read more
Visit website
Reply To: Create Copy of DB in same server.
SQLServerCentral Forum
by Mr. Brian Gale
3h ago
I think I misrepresented the "Database Owner" role and the database "owner". "Database Owner" is a role. The database "owner" is the person who created the database. Multiple people can be in the database owner role, but only 1 person can be the "owner" (aka creator) of the database. But if licensing is a concern, (depending on your licensing) you could spin up a new instance on the same server and give that account the permissions you want. Advantages to this is that you can do additional testing (such as instance upgrades) and you can spin up and shut down the instance as you see fit. If thi ..read more
Visit website
Reply To: Issues backing up Analysis Services databases - silent failures
SQLServerCentral Forum
by Mr. Brian Gale
3h ago
It depends. Is your powershell script calling a SQL script to handle the backups or are you using a 3rd party backup solution or powershell itself for the backups. My approach is different than yours. I like keeping my backups inside SQL. I have my TSQL checking the system tables for online databases to do a backup of and then we have a specific location for those to go based on instance and database name. We copy the script out to all instances and then schedule it as a SQL Agent Job. The script has error handling in it as well as logging built in, so everything is good to go. My GUESS is tha ..read more
Visit website
Reply To: Find the problematic Sql Query Caused Application Crash
SQLServerCentral Forum
by Mr. Brian Gale
3h ago
RCRock wrote: Actually Application is stable and live since many years and such kind of issue happened only few times. I am still trying to find anyway I can see the what sql query took high CPU usage which could have caused application performance down. I am not trying to say the app is bad. I have apps I've written or helped write that run fine most of the time. But if an app crashes, I've never had high CPU on the SQL instance as the culprit. High CPU usually means that SQL is slower to return results. Similar to if you have a lot of blocking. The application likely needs to be modified ..read more
Visit website
Reply To: Principal owns a service?
SQLServerCentral Forum
by frederico_fonseca
3h ago
did you look at https://w3sniff.com/code?id=95&title=The-database-principal-owns-a-service-in-the-database-and-cannot-be-dropped ..read more
Visit website
Principal owns a service?
SQLServerCentral Forum
by Brandie Tarvin
3h ago
This is one I haven't seen before. I'm trying to drop a database user and got the below message. The login doesn't own any roles or schemas or other objects and everything I google on the error comes up with "principal owns a schema" which is not what this error is. When I try googling database services, I get SQL Server level services or Windows services. Nothing helpful. I've even checked all system tables with "service" in the name and all the principal IDs = dbo, not this user's principal ID. Has anyone ever seen a "principal owns a service in the database" error inside a drop database use ..read more
Visit website
Reply To: test sql servers
SQLServerCentral Forum
by Mr. Brian Gale
3h ago
Martass wrote: Yes, my bad, but on the other hand when one 1 person works on one DB  is not going to be able to run multiple Queries, usually you are focused on one, and does not happen often to have more than 1 query running, so the my assumption was that from each db will come single query. ? That is usually the case, but I've seen scenarios where a developer (myself included) is working on multiple things at once and if the query is a long running query (ETL type work), I may have multiple queries running at once. OR if I am working on an SSIS package, I may have things running in p ..read more
Visit website
Issues backing up Analysis Services databases - silent failures
SQLServerCentral Forum
by Pete Bishop
6h ago
I have a PowerShell script that I use to automate the backup of Analysis Services databases - allows for handling new/dropped databases, dynamic filenames, etc. However, on some occasions the backup fails but no output is reported stating why. I get a success message when it works but nothing when it fails. I've tried adding a retry loop but this doesn't always solve the problem. Is there any way to identify what is going wrong or a better way of achieving what I'm trying to achieve? Thanks ..read more
Visit website

Follow SQLServerCentral Forum on FeedSpot

Continue with Google
Continue with Apple
OR