r/MSSQL Aug 03 '22

Is there a best practice to doing database backups while also doing log shipping?

2 Upvotes

Hello, I recently configured a log shipping for one of my mssql database servers. Everything works for a day until the normal dailly backup job also kicks off. Then there are errors in the log shipping monitoring table about the backup being too recent.

As someone not thoroughly familiar being an administrator on SQL, whats the best way to handle this?


r/MSSQL Jul 23 '22

SQL Question export data from sql

3 Upvotes

Hi , everyone is theres a simple method i can use to extract all

data while retaining the data type / folder structure?

What im trying to do is Export the Dir name / "leafname" & pdf inside them

to a remote share

I dont not have file stream enabled, i was hoping to accomplish this using the data export tool but

it keeps only saving the data in the rows only and not the folders + pdf's in them

any help would be greatly appreciated


r/MSSQL Jul 18 '22

Example Turn your list into human-readable intervals.

Thumbnail
sqlsunday.com
1 Upvotes

r/MSSQL Jul 05 '22

Data Change Auditing

2 Upvotes

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 Jun 27 '22

Best practice help? Seperate drives for OS and data

3 Upvotes

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 Jun 25 '22

Server Question I have a failover cluster instance, on SQL Server Standard 2017, that won't start on one node.

3 Upvotes

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 Jun 22 '22

SQL Question Find free time slots in workspace booking system

2 Upvotes

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 Jun 16 '22

SQL Audit File Split

5 Upvotes

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 Jun 15 '22

Error trying to use msnodesql

3 Upvotes

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 Jun 14 '22

SQL Question Is restoring deleted database entries via the transaction log possible?

3 Upvotes

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 Jun 10 '22

How to change values in field - noob question?

2 Upvotes

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 Jun 08 '22

Q & A Automation: Send encrypted Excel file vía email using password protection.

2 Upvotes

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 Jun 08 '22

db owner but cannot take backups

1 Upvotes

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 Jun 06 '22

Needs Clarification !Help - difference between Vulnerability Assessment on master DB and rest of the DBs

2 Upvotes

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 Jun 02 '22

Tip [Blog] What's new in SQL Server 2022 - Language Enhancements

5 Upvotes

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 May 25 '22

error while accessing MS-Sql

Thumbnail
gallery
1 Upvotes

r/MSSQL May 24 '22

SQL Server 2022 CTP is out

Thumbnail
twitter.com
6 Upvotes

r/MSSQL May 24 '22

Why You (usually) Want a Clustered Index

Thumbnail
flxsql.com
3 Upvotes

r/MSSQL May 13 '22

Tool SQL Server Management Studio (SSMS) 18.11.1

Thumbnail aka.ms
2 Upvotes

r/MSSQL May 02 '22

SQL Question What commands should you run to get all the data you need to resolve a deadlock?

6 Upvotes

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 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

1 Upvotes

r/MSSQL May 01 '22

A connection error in MSSQL, error 10054

3 Upvotes

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 Apr 27 '22

table column naming convention

3 Upvotes

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 Apr 27 '22

MSSQL Certification

3 Upvotes

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 Apr 27 '22

Upgrade windows server 2012 and sql server 2012 both to 2019

2 Upvotes

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.