Forum Widgets
Latest Discussions
How to add existing log files to a newly created filegroup ?
I have two log files which are on different drives A: \logfile1.ldf & B:\logfile2.ldf which are not part of a file group. I want to remove logfile2.ldf , but I am unable to remove it because it is not empty. I tried emptying it by shrinking , but because it is not part of the filegroup, it failed. When I tried to add the files to a newly created filegroup, using ALTER DATABASE ADD FILE( name= 'logfile1', filename='A:\logfile1.ldf') TO FILEGROUP LOGFILE I got an error message The logical file name "logfile1" is already in use. Choose a different name. So, how can I add the log files to filegroup 'LOGFILE'? Thank you.wsunarkoMar 10, 2025Copper Contributor33Views0likes2CommentsCurrent SQL Server Certifications
Hello, I had a couple Microsoft certifications many years ago and am interested in getting re-certified in SQL Server. I looked on learning.microsoft.com but couldn't find any certification options. Am I looking in the right place? Does Microsoft still offer SQL Server certifications? Thanks, BrettMango42Mar 07, 2025Copper Contributor303Views0likes2CommentsTwo missing record from this query
I have the following query: SELECT '20'||SUBSTR(CAST(T1.LMDTM1 as VarCHar(15)), 2, 6) as Date, T1.LMFSTM as Status, T1.LMREF1 as CustPO, TRIM(T1.LMREF1) ||'-'||TRIM(T1.LMREF2) as Key, T1.LMREF2 as Order, T1.LMREF3 as GUID FROM EXTSYSFCC.EXLLMQLD T1 WHERE t1.LMDTM1 = ( SELECT MAX(t2.LMDTM1) FROM EXTSYSFCC.EXLLMQLD t2 WHERE t2.LMREF2 = t1.LMREF2 ) AND LMTPC1 = 'ABC' AND LMMSID = '123' For some unknown reason to me I detected at least two records that are not included, the date field is 20250217 and the part where it skips those two records, there is at least one record with the same date, is this: t1.LMDTM1 = ( SELECT MAX(t2.LMDTM1) FROM EXTSYSFCC.EXLLMQLD t2 WHERE t2.LMREF2 = t1.LMREF2 ) If I delete that part I can see those two records. Any help will be deeply appreciated. Thanks!martipe1Mar 07, 2025Copper Contributor25Views0likes2CommentsOutlining not working in SSMS 18.x and 19.x
Edit, This problem is also present in SSMS 20.1, Does Microsoft care at all, or are they not capable of fixing this? In SSMS 18.x and 19.x, the outlining feature that allows you to collapse SQL code often stops working, i.e. the +/- next to the code disappears and neither shortcuts or clicking in the menu will collapse code. I have tried to uncheck outline statements in the option under intellisense and then recheck it, but that makes no difference. Closing SSMS and restarting sometimes helps, but after a while I'm back to the same problem. I have never had this issue in SSMS 17.x Does anyone else have this problem, and how do you solve it?SolvedMartinxNMar 06, 2025Brass Contributor7.8KViews2likes23CommentsSearch a string like '%ontario%' in ALL the tables of database
Hi, I want to search '%Ontario%'. How i can search the specific string using like command in ALL the tables of the database from one single query. I want to know which table has like 'Ontario'. ThanksSolvedSmithTorontoMar 05, 2025Copper Contributor39Views0likes4CommentsHow do I unpivot so that the value column comes at the end?
hello all, I have learning the unpivot function, according to the documentation, the clause before the FOR keyword comes at the end. But when I do it, the column before the FOR keyboard comes before the column after the FOR keyboard. please see this example I did How can I make the value column to be the final column like the documentation? Thanks you.benjamin_2024Mar 04, 2025Copper Contributor24Views0likes1CommentError converting data type varchar to numeric when running insert query
Hi , I am getting below error when trying to run insert statement even though data types are same in target table and source view Error details : Msg 8114, Level 16, State 5, Line 1 Error converting data type varchar to numeric. Insert Query INSERT INTO [Data].[Noti_Window] SELECT CONVERT(VARCHAR(16), SYSDATETIME()) AS 'RunTime', EDW.* --INTO [Data].[Noti_Window] FROM ( SELECT * FROM [Data].[Noti_EDW_PAN_TempViewIII] UNION SELECT * FROM [Data].[Noti_EDW_DOD_TempViewIII] ) AS EDW INNER JOIN [Data].[Noti_Dim_PageID] AS PgID ON EDW.PageID = PgID.PageID ; Noti Window table structure. PAN and DOD View Structure. Could you please let me know how to find out which column is causing this issue bco'z from last 1 year working fine without any issues. Thanks in Advance for your great support. Regards, Bhaskarbhaskarpbi99Feb 27, 2025Copper Contributor75Views0likes3CommentsDifference SQL Server 2022 vs 2017 Bind table
Hi, I'm Beginner SQL Server Engineer. I got some Question to SQL Server 2022, 2017 Bind table. During SQL Server practice, I heard that the bind table does not know statistical information, so there should be no IO reduction due to the index, but in the 2022 version, it seems that the index in the bind table refers to statistical information. something change between 2017 and 2022 Bind table?Solvedezpz97Feb 25, 2025Copper Contributor57Views0likes2CommentsQuery Help to show record in single row
Hi All, need help with an SQL query. Currently we are getting Start and End BNames on separate rows. DECLARE @tblData TABLE (BName varchar(50), StartDate varchar(10), StartTime varchar(10), EndDate varchar(10), EndTime varchar(10)) INSERT INTO @tblData (BName, StartDate, StartTime) VALUES ('STAT Start','02/20/2025','00:34:02') INSERT INTO @tblData (BName, StartDate, StartTime) VALUES ('STAT End','02/20/2025','00:40:36') INSERT INTO @tblData (BName, StartDate, StartTime) VALUES ('CDS Start','02/20/2025','00:40:38') INSERT INTO @tblData (BName, StartDate, StartTime) VALUES ('CDS End','02/20/2025','00:47:26') INSERT INTO @tblData (BName, StartDate, StartTime) VALUES ('LED Start','02/20/2025','00:40:42') INSERT INTO @tblData (BName, StartDate, StartTime) VALUES ('LED Start','02/20/2025','00:54:28') Current Output: EXPECTED OUTPUT: The EndDate and EndTime I want it displayed in the same row where BName like '% Start' I tried to do this through cursor by updating the EndDate and EndTime, but that is not working. Any help will be appreciated. Thanks!SQLDBA201400Feb 25, 2025Copper Contributor80Views0likes6CommentsHaving difficulties to paste data to excel ?
Hi, I need to provide data in excel format. One of the field is having varchar - I am using CAST(AP.IDINVC AS VARCHAR) as [INVOICE_ID] But I am missing the leading zero's when I copy the data from MS SQL Server Result to excel file. No of rows is 147474. How to keep the leading zeros when copying the Invoice ID from MS SQL Server result to Excel.SuvechhaFeb 25, 2025Copper Contributor26Views0likes1Comment
Resources
Tags
- Data Warehouse66 Topics
- Integration Services58 Topics
- sql server49 Topics
- Reporting Services43 Topics
- SQL41 Topics
- Business Intelligence35 Topics
- Analysis Services31 Topics
- Business Apps22 Topics
- analytics21 Topics
- ssms13 Topics