User Profile
Javier_Villegas
MVP
Joined Jan 02, 2018
User Widgets
Recent Discussions
Re: SQL Server 2019 – Repeated Recovery Mode and Backup Failure After Server Shutdown
I believe you must do a DBCC CHECKDB to evaluate if there is a problem with the database if it comes back with no error, probably the DB is going to recovery because there are long running DML sessions running when server get restarted so it requires long time to recover. you can consider to enable Accelerated Database Recovery (ADR) on that specific database https://learn.microsoft.com/en-us/sql/relational-databases/accelerated-database-recovery-concepts?view=sql-server-ver1778Views0likes0CommentsRe: Availability Group failover issue
AG is quite reliable but this king of things may happen. Is there any error log that could point out of why there was a failback from B to A and it did not started. My suggestion will be to take a maintenance Window and try to switch roles to all nodes. Also run the cluster verification process to see if you get any warning from there92Views0likes1CommentRe: Compatibility change from 110 to 160 doubles the CPU
You might be getting higher CPU usage put maybe for some time, basically when all calls get recompiled. I'll suggest you to use Query Store and maybe try to identify sessions with high cpu. You can also enable Query store that will help Additionally you can try sp_whoisactive to detect sessions taking most of the resources One more thing, check optimize for ad hoc workloads configuration that might help Regards Javier285Views0likes1CommentRe: Just downloaded SQL Server but fails to connect
Hello, you haven't provided more details but assuming you downloaded SQL 2022 and you are trying to connect from a remote computer using SQL Server Management Studio 20 , I can refer you to few links that will help to troubleshoot. note that SSMS 20 has a new dialog box to connect to servers and you might have to select "Trust Server Certificate" https://learn.microsoft.com/en-us/sql/ssms/quickstarts/ssms-connect?view=sql-server-ver16 https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/error-message-when-you-connect190Views0likes0CommentsRe: Attach a database containing file streams
Hello 1711643472 definitively backup/restore is the best option for databases with FS but I found a couple of links that might help you. I tried both options and they worked well in my lab environment https://learn.microsoft.com/en-us/answers/questions/389489/how-to-attach-an-sql-server-database-containing-fi https://www.mssqltips.com/sqlservertip/1878/how-to-detach-and-attach-a-sql-server-filestream-enabled-database/471Views0likes1CommentRe: Default SQL Server Connection for SSMS
Hello Yo cannot lock a session from SSMS. it will always go get the one from previous opened script when you do it via File -> Open I'll suggest you to use SELECT @@SERVERNAME to double check on which server your are, and also strongly suggest to use BEGIN TRANSACTION with COMMIT / ROLLBACK , especially when you are tunning ad-hoc scripts in production servers. this way you can revert in case of a mistake586Views1like1CommentRe: Unpatched known vulnerabilities SQL Server 2019 GDR
Hello I'll suggest you to apply SQL 2019 CU 28 (15.0.4385.2 - August 2024) , which includes the latest GDR released (15.0.4382.1 - July 2024) https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate282.1KViews0likes3CommentsRe: Return all fields in results
Hello, I believe this is the one you need, this will return all columns where it matches WITH A -- Get a list of unique combinations of Field1 and [Field2] AS ( SELECT Distinct Field1 [Field2] FROM myTable ) , B -- Get a list of all those Field1 values that have more than one [Field2] associated AS ( SELECT Field1 FROM A GROUP BY Field1 HAVING COUNT(*) > 1 ) SELECT A.* , B.* FROM A JOIN B ON A.Field1 = B.Field1417Views0likes1CommentRe: SQL 2008 error
Hello, This means that SQL Server is not accepting incoming connections . Can you connect locally from the SQL machine ? and I see you cannot connect from remote computers. test if TCP Port 1433 is open you can either try with telnet TELNET Servername 1433 Or Powershell https://www.sqlshack.com/powershell-sql-server-validation-utility-dbachecks/ also make sure that the windows firewall on the server is allowing TCP 1433 Also, check the CPU usage on the server, sometimes when server is extremely busy it stops accepting incoming connections569Views0likes1CommentRe: Latest Type for the every ID
Hello kasimacsys , you can do this with a CTE ;WITH CTE AS ( SELECT id, idType, dat, ROW_NUMBER() OVER (PARTITION BY id ORDER BY dat DESC) AS rn FROM ##Test GROUP BY id, idType, dat ) SELECT id, idType, 'insert into ##result values ('''+CAST(id AS VARCHAR(20))+''','''+idType+''')' FROM CTE WHERE rn <= 2 ORDER BY id, dat DESC;334Views0likes1CommentRe: How to link SQL Server drivers to iODBC on mac?
Hello I'll suggest you to verify that you have sql connectivity from outside Docker/sql container. Basically install Azure Data Studio https://learn.microsoft.com/en-us/azure-data-studio/download-azure-data-studio and try to connect to the sql instance within the container , so with that you are 100% sure that connectivity is fine. Make sure that it publish TCP port 1433 Regards Javier500Views0likes1CommentRe: SELECT query is slow in AlwaysOn primary node than secondary node
Hello, Is the AG configured as synchronous or asynchronous ? I'll guess synchronous. if that is the case you can try to switch it to verify Also clean all the caches and perform an update statistics on the involved tables Regards Javier313Views0likes1CommentRe: Error in importing Data SQL Server
Hello vishnukantsharma702 The error message is stating that the column named "InvariantName" is defined as UNIQUE so looks like your source data contains duplicate values. You can either clean up the duplicates or remove the constraint Regards Javier245Views0likes0CommentsRe: Problem with installing SSIS extension to Visual Studio
Hello have you downloaded the extension from the market place ? Are you using the latest patch for VS 2019 version? https://marketplace.visualstudio.com/items?itemName=SSIS.SqlServerIntegrationServicesProjects Regards Javier431Views0likes1CommentRe: Unable to install SQL Server integration services exe on my machine
Hello Since you are on VS 2019 I will suggest you to try with the marketplace and download the SSIS extension from there https://marketplace.visualstudio.com/items?itemName=SSIS.SqlServerIntegrationServicesProjects Regards Javier302Views0likes0CommentsRe: Need Help with SQL Server Express, Folder of CSVs and Power BI
Hi shaebert I have a similar situation and I am using DBATools , specifically the module Import-DbaCsv which allow you to imports multiple files in one shot into a SQL Table https://docs.dbatools.io/Import-DbaCsv.html It is a PowerShell tool and definitively super easy to use. Since you use SQL Express Edition you don't have a SQL Server Agent to schedule the task but you can use Windows Task Scheduler Regards Javier896Views0likes1CommentRe: where should i start ssis or ssas
Hello Bakhtawar A. if it is starting the services you should go to the Services console (services.msc) and check that both SQL Server Integration Services and SQL Server Analysis Services are in running state then you should use SQL Server Management Studio to connect to them (aka.ms/ssms) Open SSMS, go to File , Connect to Object Explorer and the in Server Type pick either SSIS or SSAS Regards Javier2KViews0likes0CommentsRe: Index rebuild job keep on failing in SQL server 2014
Hi Sujay1185 It is important to see the error message that you are getting. if you have free space on the disk means that database file is not growing so maybe autogrowth is set to none. anyway, I am not sure how you are doing index maintenance but I'll strongly suggest you to check and use Ola Hallengren solution which will provide a very detailed log in case you have failures https://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html Regards Javier599Views0likes0CommentsRe: How to shrink SQL log file in full recovery mode as my server is in primary mirroring
Hi MrGeen_blog First of all you have to make sure that transaction log usage is super low. there are multiple ways to check that but you can start by checking DBCC SQLPERF(LOGSPACE) return. you should also check LOG_REUSE_WAIT_DESC in sys.databases to see if you have to do a transaction log backup or if the log is catching up with the other replicas Finally , do not use 0,TRUNCATEONLY, I'll suggest you to first shrink it by 10% so if your current Log total file size is 100 GB , try 90GB and see if you can accomplish it Also make sure you really need to shrink it . Maybe having a big log file is not a bad thing depending on your workload Regards Javier2.4KViews0likes2Comments
Groups
Azure Data Community Leaders Hub
The Azure Data Community User Group Hub is a network of user groups leaders and event organizers focused on the Microsoft Data Platform. We exist to empower our community and provide resources to help you connect, learn and develop your skills. We want to increase visibility of user groups and grow their memberships. Please use this hub to connect with other group leaders about what’s working, what’s not working, how you grew your membership, tips for running Data Platform Events, seeking general help & support, finding speakers and more.Recent Blog Articles
No content to show