Loading...
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Adding Multiple Columns | |
I need to add two columns to my table. I have two sets of code: -- #1 ALTER TABLE dbo.Test1 ADD CustCount INT GO ALTER TABLE dbo.Test1 ADD CustName VARCHAR(20) GO or this code: -- #2 ALTER TABLE dbo.Test1 ADD CustCount INT, CustName VARCHAR(20) GO Which set of code can I use? | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
Minimal DOP Feedback When SQL Server 2022 adjusts DOP using the DOP feedback feature of Intelligent Query Processing, what is the minimal level that can be chosen? Answer: 2 Explanation: The minimal level is 2. Ref: DOP Feedback - https://learn.microsoft.com/en-us/sql/relational-databases/performance/intelligent-query-processing-feedback?view=sql-server-ver16#degree-of-parallelism-dop-feedback |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
slow processing - Hi Experts, Yesterday, we ran a program and it has processed 1500 records in 2 min. Today, it is running for past 90 minutes and processed only 350 records so far. What should be checked apart from blocking? Cheers, Bob |
SQL Server 2016 - Administration |
multiple PAGELATCH_UP waits on data file - Hi Experts, What is meant by PAGELATCH_UP waittype ? what does it trying to tell me? what is PFS ? why INSERTS are blocking each other? As per knowledge, insert shouldn’t block each other? Since they are getting blocked , waiting for LCK and so went to suspended state. Does this indicate a highly transactional […] |
Error: 18456, Severity: 14, State: 149, no matter what I try - Hello experts, I'm seeing a strange issue. A user reported that they could not log in with their AD account. When I checked the logs, I saw the following error: Error: 18456, Severity: 14, State: 149. Login-based server access validation failed with an infrastructure error. Login lacks connect endpoint permission. I went through all the […] |
SQL Server 2016 - Development and T-SQL |
dynamic update to SP - Looking for suggestions\examples of how to update a SP that the table used changes each month at midnight. The app creates a new detail table it logs information to. example: sqlt_data_1_2023_03 when 04/01 hits a new table is created called sqlt_data_1_2023_04, and how could I use an automated method to update any SP to the […] |
Pivot and group by sum sql - Hello, I am trying to build an output that takes data from a table in the following format and pivots the unit column while summing each chunk of time by the Time_2 Field, for each hour of each day. For example see test table below. The sum of Units field 0.071+0.083+0.072+0.062 for Time_2 for hour […] |
same Procedure with same source tables in 2 environments but delay in exec in 1 - Good Morning, I have the below procedure, in both UAT & PROD same data in source tables (record counts also matched for all source tables in both UAT & PROD) but UAT takes only 1 minute and Prod takes 11 minutes. any idea what can I do/check to make it run faster. just fyi I […] |
Administration - SQL Server 2014 |
SSRS 2014 redirects to http instead of https - Hi , I am looking to find a solution for the SSRS 2014 server redirects to http url instead of https for all the subreports and other report parts like subscription , security , datasources etc . What I have done so far on the rsreportserver config file changed the value for from 0 […] |
SQL Server 2019 - Administration |
Production Rollback - Hi, is it possible to restore an SQL Server DB to an earlier snapshot while preserving the work performed after the snapshot? I was thinking about backing up the transaction log, reverting to the earlier snapshot, then restoring the backed up transaction log. However, I can imagine problems if there are any format changes between […] |
SQL Server 2019 - Development |
Monitoring third party database to detect updates without modifying the database - Hello folks, Even writing the title, it sounds oxymoronic but bear with me. We have a third party vendor application with it's own front end the business uses. Specific tables from the vendors database are replicated into our SQL server via a vendor managed process. (AWS Data Sync) Historically we have made use of the […] |
T-SQL Recursive CTE not completing at last record - I want to be able to recursively go through the contents of a temp table without using a loop and complete at the last record (ID = 4) and perform a set of statements my data looks like this DROP TABLE IF EXISTS [#ChannelInfo] CREATE TABLE [#ChannelInfo]( [ID] [bigint] NULL, [SerialNumber] [nvarchar](60) NULL, [channelid] [int] […] |
Use a recursive CTE to produce 1 update statement using dynamic SQL - I want to be able to generate 1 merge statement rather than loop through a lookup table using a single Set based Recursive CTE statement but im struggling on this. I have a set of tables which are update by means of a look up table using a merge statement This is the look up […] |
Query to Update balance based on columns from two different rows. - Hello All, Below is the my existing table structure from which I am trying to do an update statement. I need a query to update records for each employee and subtract it from a column value of different row. For example in the above case query should update the value in closing balance for […] |
Finding duplicates based on count on different fields - Hello everyone 0 I have a Contact table which has columns like ContactID, Nationalidnumber, Firstname, Birthdate, Mobilephone, Emailaddress, CreatedOn and so on. I want to find duplicate contactIDs where two or more rows has: same Nationalidnumber AND same (Birthdate + Mobilephone) combination AND same (Birthdate + Emailaddress) combination AND same (Firstname + Mobilephone) combination AND […] |
SQL Azure - Administration |
Azure SQL database AAD user management - I have an Azure SQL DB where I have set up the Azure active directory admin as an azure active directory security group. My AAD account is a member of that group. Now I am trying to authenticate to that database through SSMS as my AAD account (Azure active directory - Universal with MFA) and […] |
SQL Server 2022 - Development |
Matching the table - Hi All, I have two table called TableA and TableB. Here I need to match the TableB records from TableA. TableA http://www.funoppia.com www.finkeyz.com w.astronecollege.com http://learningberg.com http://www.mytutorials.co.in http://www.firki.co TableB funoppia.com http:/finkeyz.com ww.astronecollege.com https://learningberg.com mytutorials.com firki.com I need to find the matching records from TableB in TableA |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Loading...
Loading...