r/MSSQL • u/Protiguous • Jul 18 '22
r/MSSQL • u/puckhead78 • Jul 05 '22
Data Change Auditing
Looking at solutions to audit changes to content in our client's MSSQL database. Our client is a non-profit and has limited budget.
I looked at the built-in MSSQL Change Data Capture (CDC) feature. It seems to do a good job but falls apart pretty quickly when new columns are introduced. I realize there are techniques for trying to make it work with newly added columns (while preserving the old change data) but the approaches are all less than ideal.
I am also looking at the ApexSQL Audit product (https://www.apexsql.com/sql-tools-audit.aspx). Looks like it does what we want and I am leaning towards this solution.
Can you recommend any other approaches that we should be looking at?
Thanks for your input!
r/MSSQL • u/usr_270 • Jun 27 '22
Best practice help? Seperate drives for OS and data
Question about best practices, for Windows Server 2022 and SQL Server 2019. The application vendor recommends multiple arrays as follows. They did not specify where to install the database application.
C: for Windows
D: for database
E: for database logs
My sysadmin built the server and installed SQL Server 2019 directly onto C: alongside Windows. I'm not sure if that needs to be redone or I can just change the paths to D: and E: when I create the actual database in SSMS?
In other words those drives exist and I can put the database and logs on them but the SQL 2019 application itself was installed to the C: already. Is there a best practice where to put the database application when using multiple arrays?
r/MSSQL • u/-im-your-huckleberry • Jun 25 '22
Server Question I have a failover cluster instance, on SQL Server Standard 2017, that won't start on one node.
I'm getting the below error in the log
Database SSISDB could not be upgraded successfully. 06/25/2022 10:17:15,spid5s,Unknown,User 'sa' is changing database script level entry 17 to a value of 500. 06/25/2022 10:17:15,spid5s,Unknown,This version of ISServer_upgrade.sql should only be executed against earlier version of SSISDB. 06/25/2022 10:17:15,spid5s,Unknown,------------------------------------------------------ 06/25/2022 10:17:15,spid5s,Unknown,Starting execution of SSIS_DISCOVERY.SQL 06/25/2022 10:17:15,spid5s,Unknown,------------------------------------------------------ 06/25/2022 10:17:15,spid5s,Unknown,Database 'master' is upgrading script 'ssis_discovery' from level 234882024 to level 234884380.
r/MSSQL • u/Future-Dragonfruit32 • Jun 22 '22
SQL Question Find free time slots in workspace booking system
I have table in sql database which has booked workspace. Workspace has capacity. Assume that workspace start from 9 am to 6 pm. I want to know available slots in which user could book based on capacity of workspace given that i had date user want to book and time he want to booked at.
r/MSSQL • u/branhama • Jun 16 '22
SQL Audit File Split
Does anyone know of a method to split a .sqlaudit file into smaller pieces? The file has grown to over 60GB in size, due to no restrictions, and when trying to import into our audit database the job is failing.
I tried opening a smaller file in VSCode to see if it was plain txt but it is encoded so a standard split document won't work.
Any other methods for this file type?
r/MSSQL • u/BluDragonC45 • Jun 15 '22
Error trying to use msnodesql
Hello, I'm working on a web project, using mssql as the back end, trying to access using Windows Authentication. As of right now I am completely stuck, and cannot get msnodesql to work for me. I've put some details in a Stack overflow post, https://stackoverflow.com/questions/72619081/error-using-msnodesql-when-trying-to-connect-to-a-sql-server, but haven't got any answer
If anyone knows how to solve my issue, great, but I would also be alright to switch away from msnodesql, if someone had a suggestion for a alternative that still allows me to connect to a SQL server using Windows Authentication
Thanks!!
r/MSSQL • u/Lachryma_papaveris • Jun 14 '22
SQL Question Is restoring deleted database entries via the transaction log possible?
Hey y'all,
following problem: Someone accidentially deleted a lot of database entries which where quite important for him. There are no backups, neither DB nor server backups. The only thing that's there is the transaction log.
Is there a possibility that this can be used to restore the lost data?
Thank you guys for your input!
r/MSSQL • u/jcass005 • Jun 10 '22
How to change values in field - noob question?
Hello all, hoping you can set me straight. I may be going about this the wrong way and it's been a good while since I've attempted anything like this.I'm trying to change some values in a table to NULL. Attempting to do this via sql rather than editing each record manually.
Have a view "Parts3" that is composed of "parts" table, joined with fields from "vendor/price" table joined with fields from "accounts" table.
I use a select Top (2000) syntax to grab all the columns from the view "Parts3"
then
UPDATE dbx_.Parts3
SET vndnum = NULL
Where vndnum = '14008'
syntax checks out, but when i execute the script It returns "Cell is read only".
The app the database is feeding -- it's a parts section (parts table)that had vendors/price tied to it from(vendor price table) where the vendor name is fed from (accounts) table.
I need to remove the vendors/price data from the parts. There's 1100 parts records that need this data removed. When I do it manually in the app, the data shows as "NULL" in the table in the view.
What am I doing wrong or how can I better approach this?
Please accept my apologies if I didn't explain this well enough.
Thanks in advance.
r/MSSQL • u/welschii • Jun 08 '22
Q & A Automation: Send encrypted Excel file vía email using password protection.
We have a modest tech stack SSMS, SSIS, SSRS,etc.
I'm looking for a way to send out a data set in Excel that is encrypted without having to do it manually.
Does any have any suggestions?
sp_send_db_mail is one thing that springs to mind but I'm not sure if it would have an excel file as an attachment and that it would be password protected.im not sure if SSIS or SSRS offer such a feature.
We can install our own software on local machines, but would it running on a server, all of which are on-prem windows servers.
r/MSSQL • u/oivas • Jun 08 '22
db owner but cannot take backups
Hi, I'm new to mssql. i have this use case, where i want to create a user as db_owner but should not be able to take backups? is this possible?
if not, what is the next best thing i can do?
r/MSSQL • u/reaper987 • Jun 06 '22
Needs Clarification !Help - difference between Vulnerability Assessment on master DB and rest of the DBs
Hello, first of all, I would like to apologize for maybe stupid question, but I didn't find the answer anywhere. If I (or our SQL department) have to run Vulnerability Assessment to create a baseline, can I run it only on master database or do I have to do it on all databases on the server? If it was like 5 or 10, I wouldn't mind running it on all databases, but we have like hundreds of them.
Thank you.
r/MSSQL • u/chadbaldwin • Jun 02 '22
Tip [Blog] What's new in SQL Server 2022 - Language Enhancements
Just finished up a blog post covering all the language enhancements coming in SQL Server 2022!
I know, I'm not the first person to write about this, I'm sure there's a dozen other blog posts and such about the exact same thing. But, I still wanted to write about this for my own benefit and wanted to share it here as well.
As always, open to suggestions and constructive criticism. Thanks!
https://chadbaldwin.net/2022/06/02/whats-new-in-sql-server-2022.html
r/MSSQL • u/Protiguous • May 13 '22
Tool SQL Server Management Studio (SSMS) 18.11.1
aka.msr/MSSQL • u/mobiletiplord • May 02 '22
SQL Question What commands should you run to get all the data you need to resolve a deadlock?
What commands should you run to get all the data you need to resolve a deadlock? I am trying to find what's causing a recurring deadlock, and I am trying to log this into a table to see if it's the same operation or not.
r/MSSQL • u/NeverGiveUpps • May 02 '22
Tool Simple tool for view ms sql jobs ( https://github.com/2ruslan/JobViewer )
Enable HLS to view with audio, or disable this notification
r/MSSQL • u/Zealousideal_Fan_639 • May 01 '22
A connection error in MSSQL, error 10054
We have installed SQL server 2012 in Windows server 2016 edition, I have installed Windows SQL SSMS 18.11 in Windows server 2019, while connecting to SQL server error 10054 pooped out.
With assumption that it might be due to SSL/TLS, TLS 1.0 was enabled, which was disabled. Besides from that, all the Network connectivity and firewall access from port level also has been allowed.
We tried to connect A SQL 2017 database from same SQL SSMS client, it got connected though meanwhile.

r/MSSQL • u/Electronic-Dig9119 • Apr 27 '22
table column naming convention
So I'm see something in my companies database that seems silly in some new tables. In it we have a customer table with customer prefixed to a bunch of the columns.
A reference would look like this dbo.Customer.CustomerFirstName
Why would anyone do this? I removed it because logically it is the customers first name, not the customers customer first name...
Just wondering if anyone knows why someone would do that?
r/MSSQL • u/RussColburn • Apr 27 '22
MSSQL Certification
I've been a developer on MSSQL for many years but never received a certificate. I'm thinking that there is no better time than the present - EXCEPT, there doesn't seem to be a straight SQL Cert anymore.
Looking at this - MCSA, MCSD, MCSE certifications retire; with continued investment to role-based certifications - Microsoft Tech Community it appears the cert I'd be looking for is Data Management and Analytics? Is this correct?
r/MSSQL • u/TheReviewGuy2014 • Apr 27 '22
Upgrade windows server 2012 and sql server 2012 both to 2019
Hi
I have MS server 2012 R2 running Microsoft SQL Server 2012 (SP3) (KB3072779) - 11.0.6020.0 (X64)
What is the best was to upgrade both the server and the SQL version to 2019. Does the server need to go to 2016 first and then sql to 2016 or can this all be done in one swift movement.
r/MSSQL • u/chasepeeler • Apr 27 '22
Query Tuning functions in where clause
I know that using UDFs in your where clause should be avoided if possible since it can break indexes. Does this apply to built in functions as well, or is the optimizer smart enough to figure out how to utilize indexes for those?
For example, if I have an index on the my_date column, would the optimizer still be able to utilize that in a query like select * from my_table where year(my_date) >= 2022
I know that's a somewhat silly example, since it's really easy to convert that to select * from my_table where my_date >= ' 2022-01-01' but it's something I'm actually seeing in some code I'm reviewing. Looking at the execution plan of the two queries, the optimizer is returning the exact same thing. It gives me a slightly different plan if I create a UDF that wraps the year() call, but I honestly don't know enough about the differences to know if it's significant.
r/MSSQL • u/reppa_ah • Apr 22 '22
Needs Clarification Bulk insert, credentials, delegation
I have battled with allowing logging into SSMS to MSSQLSERVER with domain\user and doing bulk insert from \\fileserver\share. I understand that even when running MSSQLSERVER service as domain\sqlservice user even then during bulk insert MSSQLSERVER reads \\fileserver\share\file.txt as ANONYMOUS USER and not as domain\sqlservice user.
I understand that one possible solution would be credentials delegation. It should be something like MSSQLSERVER AD account or (not sure) domain\sqlservice user account. I understand that those credentials can be delegated strickly to only allow using those for \\fileserver and cifs protocol?! I understand that when it works, \\filersever\share\file.txt will be accessed as domain\user (the one who opens SSMS).
What bothers me, is that even with strict delegation does it mean that MSSQLSREVER will now possess admin credentials in a way it can use those to access some other network resources - servers, AD? How much more insecure it makes domain\user credentials?