|
|
|
|
|
|
|
Question of the Day |
Today's question (by tomaz.kastrun): | |
Using R apply | |
Using famous IRIS dataset, which result this APPLY function returns:
apply(iris[,1:4], 1, sum) | |
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) |
Removing a Column I added a new column to a table with this code: ALTER TABLE dbo.Summit2022 ADD QuoteByURL VARCHAR(200) While I think this is a good idea, it needs to be tested by others and reviewed. Because this might be an issue, I also want an undo script that can be run to remove this change if it's a problem. What should I put in the undo script? Answer: ALTER TABLE dbo.Summit2022 DROP COLUMN QuoteByURL Explanation: While the ADD to a table works without without the COLUMN, the DROP requires the COLUMN keyword. Ref: ALTER TABLE - https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql?view=sql-server-ver16 |
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 2016 - Development and T-SQL |
How to calculate time difference? - Hello everyone, I have a table logs which maintains file names and date and time at which they were loaded into Sql server database table. The table looks like this: S.No Step_name File_name Date_time Minutes_difference 1 File Loaded Individual_1.xml 9-15-22 10:50 AM ? 2 File Loaded Individual_2.xml 9-15-22 11:00 AM ? 3 File Loaded Individual_3.xml […] |
SQL Server 2012 - T-SQL |
Tsql batch script does not stop - We have the following update script we are trying to do in batches. Currently the execution never stops running - so needed help understanding what's wrong with the logic or syntax thats missing. -Create Temp table create table #TempIFSC ( [EnrolledPaymentMethodAccountId] uniqueidentifier, [PaymentAccountId] uniqueidentifier, [ExternalSystemId] int, [EnrolledPaymentMethodAccountStatusId] int, [Extension] xml, [EnrollmentAccountRevisionId] int, [BankName] NVARCHAR(100) NULL, […] |
SQL Server 2019 - Administration |
Log shipping TO Always On Availability Group? - Hi, I've been trying to find the answer on the internet but was not successful. I don't have the setup done yet (hence can't try it out) but this is basically how it's going to look like: Produktion: 2 servers - Always On Availability Group - SQL 2019 Standard Edition hence no secondary read only […] |
Dynamic column result data - Hi, First of all pls don't comment on table structure. its already created we cannot change anything. I have 3 table like below. ##Invoice (which has the unique data) and ##ReInvoice (we will submit until its get fully paid. here we maintain level) and ##Payment (which has the payment history also maintain level) create table […] |
host-based authentication possible? - Hi! is host-based authentication possible? e.g. : userA is allowed to login from 192.168.80.0/24 userB is allowed to login only from 127.0.0.1 userC is allowed to login from any host |
backup practice/strategy/risks - I have a current job that does FULL backup to all my USER DBs daily and system DBs weekly. I do not do DIFF at all. only Log for those full recovery model. Are there any risks to this practice when it comes to restoring in case i need to. Thanks |
SQL Server 2019 - Development |
a good book on SQL - Hello! Would someone please recommend a good book on SQL development? As an example, I consider "C# 10 in a Nutshell" by Joseph Ablahari a good book. Though concise, it covers lots of material. |
How to get Key based on type and sub type - I Have sample data that looks like below. We have similar data like below for ton's of different keys. for each key data will be like 5 to 6 rows based on type and sub type ; I need to get the Key from the below records where the data set contain type COLL and […] |
How to change STRING_AGG to stuff xml to split feature value by pip? - I work on sql server 2019 . i can't write query below with stuff for xml . so how to change STRING_AGG to stuff xml ? query below take too much time so i need to try with stuff for xml to reduce time cost . query i try it select a.RecomendationId, cast(STRING_AGG(cast(f1.FeatureValue as varchar(300)) ,'|') WITHIN GROUP (ORDER BY f1.FeatureId ASC) as […] |
Working with Oracle |
Is each serializable schedule view serializable? - We are aware that conflict serializability is a valid subset of view serializability in DBMS Schedules of Transactions. However, all serializable schedules may be included in view serializable schedules. A suitable subset of view serializability, maybe, or another option? Has this been examined? |
General Cloud Computing Questions |
Suggest cloud provider for SQL - I am a MERN stack developer and we need to work with SQL for a project. Can anyone suggest a good FREE cloud SQL server having low storage with which my Node backend can connect using an URI (Like Atlas for MongoDB). Our backend developer is left in the dark with this sudden and urgent […] |
Reporting Services |
Exporting user names and passwords - We are in the process of moving SSRS 2104 web servers in a scale out deployment from one domain to another. The unfortunate thing is that the production environment is not even close to the lower environments, mainly because of some really bad practices that I inherited and subsequently stopped from happening. So, we were […] |
General |
script task and excel format syntax - Hello, I'm a newbie to script tasks and new some assistance. When using SSIS/script task, I have the following code which creates excel files in xls format. However, I would like to create them in xlsx format - what do I need to change in the code. Thank you. Public Sub Main() Dim url, […] |
Integration Services |
Use ForEachLoop to split data by unique field in source and create an excel file - Hello, I'm trying to create excel files that hold data for each Invoice Id by using a Foreach Loop Container (FLC). I have successfully created the source query that lists all the distinct invoice Id's with results held in a variable (Result Set). Then successfully configured FLC to be a Foreach ADO enumerator and picking […] |
Administration |
EventID - 833 - Hi, We have Sql server 2005. User databases are in one drive and system databases are in C:/ drive. We are gettting alerts about Event ID: 833 from both user databases and system databases? Is surely indicate IO issues? |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |