mssql server
11 Topicsadding computed column to MS SQL
would like to check how to add a computed column with the following requirement Column value will be C-yyyyMMdd-0001 where date will be from the CreatedDate column in the same table. 0001 is an auto-incremental value based on when the record is inserted on the same day eg, the first record added on 23/08/2025, the computed column will be C-20250823-0001. As the table may already contain existing data, a SQL script may also be necessary to update this new column with the correct value.64Views0likes3CommentsSQL Help : Time difference for events within a specific group that resets based on an anchor event
Hi All, Need help with an SQL query to find the time difference between events that happen in sequence, where an anchor event resets the calculation. Below is the sample data and the expected output. thanksSolved222Views0likes5CommentsGetting Started with Entity Framework Core
Today, we’ll discover a method to integrate database support into an ASP.NET Core API using Entity Framework Core. A database stands as a vital component in many applications, serving as the storage and retrieval hub for data. Traditionally, developers had to convert C# data access code into SQL statements, a process open to errors and time-consuming. However, with Entity Framework Core, you can delegate the tasks to the framework, allowing you to concentrate on application development.739Views0likes0CommentsCannot Disable Named Pipes
I have an installation of SQL Server 2022. I have a named instance. When I set the port to a non default port, I cannot disable the named Pipes (SQL Server cannot start). When I change the port to the default port 1433, the named pipes can be disabled without any issue. Is this correct?496Views0likes4CommentsAlways On Availability Group -- Disk resize on the secondary replica
Hi, We currently have a 2 node on Always ON Availability group with a cloud witness. Recently, we found the need to resize the data file disk. This 2 nodes are SQL Server on Azure VM. Find below our current situation 1st Resize on the secondary node (read-only) Resizing first on the secondary node - we noticed that the disk type changed from Basic to Dynamic mode and having seen some documentation on internet -- https://lokna.no/?p=1384 we thought of been cautious of having the disk in dynamic mode. As a result of the above, we did not proceed to resizing the the production until we are sure. Question Is it save to proceed with disk in dynamic mode? What if we proceed and the primary is still on Basic mode, is it OK to have the disk type of primary node as Basic and the disk type of secondary as Dynamic? Thanks340Views0likes0CommentsHELP with CTE or a Cursor to update multiple rows in 1 table ..selecting from Multiple databases
Server A Syetemtable of Dbname= ABC Dbname productid ABC 123 Syetemtable of Dbname= XYZ Dbname productid ABC 987 Syetemtable of Dbname= AQW Dbname productid AQW 123456 Like we have 1000 DB's in Server A and each db has a system table 1 Main LOGIN info table in Server A Dabatase DB1 SELECT * from DB1. DBO.LOGIN table DBName product ID ABC NULL XYZ A9065 AQW mailto:33c@1442 these rows in 1 main Login table are not matching the system table rows of each individual Databases Now I want to update 1 Main LOGIN info table in Server A Dabatase DB1, so that I get results matching each login table of all db's SELECT * from DB1. DBO.LOGIN table DBName product ID ABC 123 XYZ 987 AQW 123456720Views0likes3CommentsHow to provide password for SQL server remote
Hi Team, I am stuck with connecting Azure pipeline to remote SQL server. I have a powershell run as command to connect to SQL server remote, but I am unable to understand how do I set/provide password for that connection string. I will be greatful if you can help me assist on this.935Views0likes2CommentsCan't delete memory optimized tables
Hey everyone! We have a problem that is unsolvable for us. I hope that someone has already had this case or has enough expertise to find a solution for it. Introduction: We did a reallocation of de databasefiles (.mdf) and the logfiles (.ldf). We wanted to split all databasefiles to a datadrive and all logfiles to a logdrive. Apparently some days later one specific database reached the Suspect-mode: We were able to get the database back online through creating a new database with the existing logfile and databasefile. Apparently some of the tables are memory-optimized and no longer work. We have to delete these specific memory optimized tables, but we were not able to do that: We tried everything, even restoring the missing "memory optimized db" files: Dropping the mem_opt_filegroup first also fails (seems to happen because the mem_opt_filegroup is a restore from 3 months ago): As a side info, I am on a restore in an isolated environment. Thank you in advance for any support.525Views0likes0CommentsCombining names in SQL
I have a report I'm working on in power BI and I would like to combine Samantha Marshall who is now now Samantha Murphy. What is the query I should write? -->I tried the following with no luck Update [Table name] Set created_by = 'Samantha Murphy' where created_by = 'Samantha Marshall'338Views0likes0CommentsTLS 1.2 support on SQL server 2014
We have SQL server 2014 (with sp3 installed) hosted on Windows Server 2012 R2. Recently our client application upgraded to use OpenSSL 3.0.8 and we are restricting to use TLSv1.2 & TLSv1.3 only. Now our client application is not able to connect to SQL server via ODBC driver 17/18. I tried enabling TLSv1.2 on SQL server 2014 including applying service pack3 (https://support.microsoft.com/en-us/topic/kb3135244-tls-1-2-support-for-microsoft-sql-server-e4472ef8-90a9-13c1-e4d8-44aad198cdbe), updating host OS, updating .NET on host OS, adding registry entries to Schannel, enabling group policy to use FIPS enabled ciphers, etc. Unfortunately none of these solved the issue. I tried to diagnose the issue with openssl/sslscan utilities, but they are also not able to connect to the server on port 1433. Client waits for 'server hello' during handshake and timeout happens. The Windows/system log shows the errors: 1. 36874 : An TLS 1.2 connection request was received from a remote client application, but none of the cipher suites supported by the client application are supported by the server. The SSL connection request has failed. 2. 36888: A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 40. The windows schannel error state is 1205. Note that, same client can connect to another instance of SQL server 2016 hosted on another server without any issue. Could you please suggest what more configuration we are missing on SQL server 2014?1.4KViews0likes0Comments