|
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Combining Numpy Arrays | |
I've got two sets of data that I created as follow:
>>> import numpy as np >>> training_set = np.array([1,2,3]) >>> testing_set = np.array([[4,5,6], [7,8,9]]) >>> testing_set array([[4, 5, 6], [7, 8, 9]]) >>> training_set array([1, 2, 3])I want to combine these into one set, called complete_set. How can I do this? | |
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) |
Indexing A Numeric Computed Column I have a table with a column defined like this: SalePrice NUMERIC(10,4) I then created a computed column on this field: ALTER TABLE dbo.MonthlySales ADD EstSalePrice AS ROUND(SalePrice, 0) I want to index this column with the following code. CREATE INDEX MonthlySales_EstSalePrice ON dbo.MonthlySales (EstSalePrice) What happens when I run this? Answer: The index is created Explanation: This works fine. You can create the computed column and create an index on this field. Ref: Indexes on Computed Columns - https://docs.microsoft.com/en-us/sql/relational-databases/indexes/indexes-on-computed-columns?view=sql-server-2017 |
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 |
Definition of Commercial Data? - I have a scenario where a vendor is setting up a test environment and they plan on pulling the data from production for testing. This environment is not and will not ever be used for production purposes but does the actual data source dictate the environment and thus negate the terms of a developer environement? […] |
SQL Server 2017 - Development |
Insert forum posts/threads in the DB table - I would like to insert a forum posts/threads in the database and then be able to manipulate them. What programming language do I need to use to insert these posts/threads in the database table? |
SQL Server 2016 - Administration |
Data Collection not working after installing SP2 - We patched an SQL Server 2016 installation with SP2. For this installation, Data Collection was activated with the default System Data Collection Sets. However, after the patching, the collection job for the Server Activity failed with the following message: Message Executed as user: . The step did not generate any output. Process Exit Code -1073741819. […] |
Error while creating clustered index - Hi Experts, While trying to create a clustered idx on a HEAP Table, we are seeing below error. How to avoid this error. This Table is originally a HEAP and now we wanted to remove fragmentation (~25Gb), so tried creating clustered on this table using SSMS. It is throwing Timeout error. How to fix this? […] |
rebuild is failing - Hi Experts, One of the HEAP table rebuild operation is failing in one of our dev env. Have some few questions, kindly help. >ALTER TABLE HeapTbl REBUILD; There is a HEAP table which has 88% fragmentation and it is around ~25GB. The table also contains LOB datatypes columns as well. When we try to rebuild […] |
Vendor recommendations - Looking for which option for stats update would be best - Running SQL 2016 Enterprise on Windows 2016 We upgraded to a new version of this product and having slowness issues. The vendor keeps running their tool and tells us sample percentage needs to be 100% for all statistics. The problem is the auto update statistics keeps updating them and so they are not 100% We […] |
SQL Server 2016 - Development and T-SQL |
MSDTC issue on SQL Server clusters - Dear All, I have sql server 2016 with 5 clustered instances on the box. We are using Local DTC for these. currently we have DB's on 2 of these instances. But problem is MSDTC is working on only 1 instance at a time. When we reboot the server, the issue is resolved on 1 instance, […] |
Administration - SQL Server 2014 |
error while adding db back to always on - Hi, we configured alwayson with 15 dbs in sql 2014. we configured full,diff and log backups. due to some reason the yesterday all log backups failed. due to this the logs grown hugely. i fixed the log backup drive.after taking continuous log backups and shrinking the log files three of the dbs logs were huge […] |
SQL 2012 - General |
SQL query to return only voided records unless they exists once - Hi i am running: PL/SQL Developer Version 9.0.4 Oracle database 12C My issue is that i cant figure out how to make a query that will keep all the green records but exclude the red one, we have had some unfortunate registrations in our DB so instead om people moving records they have used […] |
SQL Server 2012 - T-SQL |
Checking if a value has been set/changed in week/month from audit table - Greetings, I'm struggling to find a solution to find when a value is set or changed to specific value (12 in the supplied example) within a time period (month for instance). Unfortunately the audit table, holds many different status values, with a new record written any time one the status column values change. It could […] |
SQL Server Newbies |
Where can I retrieve historical database performance report? - Hi, I would want to know, how can I get a report of the DB performance for a particular time frame? A few of my users reported some slowness for a certain jobs accessing a table during a specific timeframe. I was hoping to pull a report out to see if there's any abnormal high […] |
Reporting Services |
Label Printing (Contacts) - Dynamics 365 Online - Greetings! I am using MS Dynamics 365 CRM online and I need to achieve label printing functionality to print name and address of contacts from my table in to MS Word using SSRS. This after proof reading will be printed on a pre-designed A4 size stationery that has 10 rows and 3 columns and can […] |
Integration Services |
Export to csv then FTP using variables - Hi, Ive created a package that exports using a dynamic filename but for the life of me, i cannot get it to ftp over then delete from the source. I have a data flow and ftp task. It should use parameters to create the filename based on the date. This works and a file is […] |
compression file - Error: Exception has been thrown by the target of an invocati - #Region "Imports" Imports System Imports System.IO Imports System.IO.Compression #End Region Public Sub Main() Dim FolderPathToZip As String = "C:\HOWTO_SSIS\Prj03\start\" Dim sArqOrigem As String = "Selenium.txt" ZipFile.CreateFromDirectory(FolderPathToZip, sArqOrigem) Dts.TaskResult = ScriptResults.Success End Sub 'ERROR: Exception has been thrown by the target of an invocation. |
General |
count number of days between two dates excluding weekends for a particular month - Hi guys, got a conundrum here that i'm pretty sure is possilbe but can't get my head around. I have a table that contains 5 fields - engineername, startdate, starttime, enddate, endtime (varchar, datetime, datetime, datetime, datetime) - see "capture.jpg" attachment. i want to be able to produce a list of results that shows the […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |