Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Development |
Purging / deleting ExternalMailQueue which has around 700,000 records - What is the easy way to purge ExternalMailQueue ? I tried using END Conversation command but it takes lot of time. I dont want to retain any history. What is the quick and dirty way to clear all mail items including Queue. |
Migration of 2008 db to 2016 db causing varchar(max) issues - hi, I am trying to migrate databases and we have huge tables like 30million records , and migration is done using azure devops. So, during DMA (Data migration assistance) changes being applied to tables , as we changed a column i.e column A dataytype of varchar(max) to column nvarchar(max) taking for hours on that table. […] |
SQL Server 2016 - Development and T-SQL |
sys.object - I have a table that is empty and it should have data in it. I need to find a stored procedure or table(s) that populates this table. How do i modify this code to get what i need? DECLARE @ObjectName NVARCHAR(261) = N'sys.object' ; --===== Find the objects referencing our object by name. SELECT RefObjectName […] |
QUERY HELP - Hello. I need help with the following query: declare @T table ( ID int not null primary key , VAL int null ); insert into @T (ID, VAL) values (1, 1000), (2, null), (3, null), (4, null) , (5, 2000), (6, null), (7, null), (8, null) ; select T.* , ( select S.VAL from @T […] |
Development - SQL Server 2014 |
Query Help - Hello. I need help with the following query: declare @T table ( ID int not null primary key , VAL int null ); insert into @T (ID, VAL) values (1, 1000), (2, null), (3, null), (4, null) , (5, 2000), (6, null), (7, null), (8, null) ; select T.* , ( select S.VAL from @T […] |
SQL 2012 - General |
2012 new database & login auditing - Morning all, SQL 2012 Ent. I want a job to run that will alert me to the creation of new dbs, logins, and certain permission changes to logins. I can write my own checker & schedule but I'm wondering if you good people have a better way! If not thank you. |
SQL Server 2019 - Administration |
Import Agent job history from another server - Hello experts, I'm working on a SQL Server migration, and the clients just asked me to copy the job history from the old server to the new server. For some reason, no one has ever asked me to do this before, so when I was first setting up the new server, I just scripted out […] |
AG failover failing - Duplicate IP error - Hi guys, Testing our AG failover we noticed that we get an failure when moving to any node other that Node1 of our cluster. It is failing to bring the IP of the AG online due to a conflict. When looking at the ipconfig output I can see that the IP for the […] |
SQL Server 2019 - Development |
Using LAG to return prior non null value - Hello, Thanks if you can offer any assistance. I am trying to use LAG to return the previous non null value but I am not getting my desired results. I added some comments in my code showing the desired results. I do not want to use a CTE. --Microsoft SQL Server 2019 --Build a temp […] |
Can´t delete foreign key - Hi there, I try to delete a foreign key with ALTER TABLE [dbo].[Projektplanung] DROP CONSTRAINT [Projektplanung$tblLookupCountriesProjektplanung] GO But I have to cancel it and get Err 3737 afterwoods as it doesn´t finish. This worked for months now as this is built into a script where I delete the constraint and build it again after importing […] |
Error converting data type varchar to numeric issue - I tried a lot of things to fix it, and no success. I have a field called MASTER_BOL_NUMBER . According to documentation it is CHAR. I see that inside it has only blanks and numbers When I try to CAST( MASTER_BOL_NUMBER as numeric) I am getting an error "Error converting data type varchar […] |
Error converting data type varchar to numeric issue - I tried a lot of things to fix it, and no success. I have a field called MASTER_BOL_NUMBER . According to documentation it is CHAR. I see that inside it has only blanks and numbers When I try to CAST( MASTER_BOL_NUMBER as numeric) I am getting an error "Error converting data type varchar […] |
Date vs Datetime recommendation - I'm looking for some advice: I'm taking in files that have birth dates, and other date fields that do not require any time portion. I was using datetime for all date related fields and tried to switch them all to DATE. When I then exported the data to Text files I noticed all the fields […] |
Reporting Services |
Create a report to count the # of days a physician has a case assigned - Hi, I need to create a report that has created date, physician name, case #. I need to display the following in the report. Average # of days a physician had the followig number of cases assigned: >6 >7 8 Here is my query. select a.accession_no, a.created_date, p.last_name, p.first_name, p.mid_name, p.full_name from accession_2 a […] |
Create a report to count the # of days a physician has a case assigned - Hi, I need to create a report that has created date, physician name, case #. I need to display the following in the report. Average # of days a physician had the following number of cases assigned: >6 >7 >8 Here is my query. select a.accession_no, a.created_date, p.last_name, p.first_name, p.mid_name, p.full_name from accession_2 […] |