|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Securing the password | |
I am working in PowerShell on a script to run a few SQL commands. I need to give this script to another user to execute, but under a certain context. I don't want to hard code the password into the script, and I don't want it stored in a plain text file. What cmdlet in PoSh will allow me to store a password securely for another user to pass to a script without them being able to read the value? | |
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) |
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? Answer: >>> complete_set = np.vstack([testing_set, training_set]) Explanation: The numpy.vstack function will allow you to combine arrays in a stacked fashion. When I run this, I get this: >>> complete_set = np.vstack([testing_set, training_set]) >>> complete_set array([[4, 5, 6], [7, 8, 9], [1, 2, 3]]) Ref: numpy.vstack() - https://docs.scipy.org/doc/numpy/reference/generated/numpy.vstack.html |
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 |
Availability Group creation on SQL2017 only has 2 options - Hi, I want to create an availability group in SQL2017 with "Windows Server Failover Cluster". However this option is missing in the "Specify Availability Group Options" section. I can only choose EXTERNAL or NONE. Anyone who can point me to the reason why this is like this? :/ I have already enabled Failover Cluster feature […] |
SQL Server 2017 - Development |
XML get result - Does anyone know how to get the value = "Avis" from this XML. DECLARE @myDoc XML DECLARE @ProdID VARCHAR(200) SET @myDoc = ' James McGovern aaaaaa ' SELECT @myDoc.value('/bookstore/book/span/@class', 'varchar(200)') |
SQL Server 2016 - Administration |
slower disk performance with VMWARE versus physical - Kind of open ended question but having issues with clearly degraded disk performance with our sql servers running on vmware versus physical. Anyone with past experience with this issue have any places to look? |
Log shipping jobs losing flags - We have set up log shipping between two instances, and configured the log shipping job steps with @flags=12 (Log to table, Include step output in history). However, we have noticed that after a short period of time, the flags are reset to zero, and have to be manually configured again. We have made other amendments […] |
SQL Server 2016 - Development and T-SQL |
node 1 slower than node 2 - We have a clustered sql server, 2016 SP2/CU1, enterprise, with 2 nodes. There is a c# job running that spins off 200+ parallel processes which calls a large stored procedure. When node 1 is active, the calls to the stored procedure fail with timeout expired on a specific query (a select that we know this […] |
Subqueries - My Question is what is the best way to learn subqueries? And why are they referred to as dynamic queries? Thanks |
Add row number column based on id and stages - Hello Everyone I have a table with customer ids and different stages a customer can be in starting with A , B , C and D each starting at different dates Now a customer can be in multiple stages and I want to group them as below example (column rownum) Basically this determines the batch […] |
Administration - SQL Server 2014 |
Transaction Log Shipping (No direct link) - A vendor provides a service whereby they keep a database up to date daily utilising transaction logs. They configure Transaction logs at there end to backup to a location to which we can obtain these files. How would I set up the secondary database given that the primary and secondary can not see each other. […] |
SQL Server AlwaysOn and FailoverCluster - We have one project which has Failover Cluster with two nodes and one standalone server in AlwaysON. For example: Node1(ip:192.168.100.101) and Node2(ip:192.168.100.102) in Failover Cluster with clustered IP: 192.168.100.104. And Node3 (ip:192.168.100.103). Clustered IP:(192.168.100.104) and Node3 IP:(192.168.100.103) in AlwaysON with IP: 192.168.100.105. And now we have another project where we have Node1 (ip:192.168.200.101) and Node2(ip:192.168.200.102). […] |
Development - SQL Server 2014 |
redistribute by total dollar value (not by count) - Table X: Consumer bigint (PK) CurrentGroup bigint DollarValue money I want to redistribute records in the above table to 4 different groups (currently not in table X) equally by the sum of the DollarValue (not a record count). Table X can have up to 5,000 records with a dollar value ranging from $10.00 to $10,000.00 […] |
Extracting certain numbers from a string - Hi Guys, if object_id('tempdb..#Equipment') is not null drop table #equipment create table #equipment (Category varchar(20), ItemNumber varchar(30), ExpectedResult float) insert into #equipment (Category, ItemNumber, ExpectedResult) values ('Cable', 'CB1/03BAE300FT', 300), ('Cable', 'CB1/03BAE050FT', 50), ('Cable', 'CB1/04BAE100FT', 100), ('Cable', 'CB1/04BAE150FT', 150), ('Cable', 'CB1/04BAE025FT', 25), ('Cable', 'CB1/04BAE050FT', 50), ('Cable', 'CB1/04BAE075FT', 75), ('Cable', 'CB1/04CNN050FT', 50), ('Cable', 'CB10/5BAE1000FT', 1000), ('Cable', 'CB10/5BAE100FT', […] |
SQL 2012 - General |
Single Instance vs Multiple Instances - Hi. I have 22 databases with the exact same structure (1 per client). They range in size from 500 MB to 700 GB. Right now all 22 are on the same instance of SQL 2012. The resources are 170 GB memory and 12 processors. Environment is Hyper-V. All VMs are stored on SAN. All data […] |
SQL Server 2012 - T-SQL |
Table Function becomes slow - Hi folks, I have a 2012 sql and it works very fast, one of the most used queries is a table function. This function over time becomes slow and heavy. If I add OPTION (HASH JOIN) the function is again fast (maybe faster), but only for a couple of days. I leave you an example […] |
Reporting Services |
SSRS Expression Help - I need assistance with the following requirements: I need the font on my text to equal "DimGray" when IsRunning = "Processing" else if the MostRecent.Value > today = Red else Green. With what I have below, its making them all DimGray. =Switch(Fields!IsRunning.Value ="Processing" , "DimGray", IIF(Fields!MostRecent.Value >= TODAY(), "GREEN", "RED")) |
Integration Services |
SSIS Excel Import Error - Hello, I'm an SSIS newcomer, but, far as I can tell, have done everything correctly. In a nutshell, I need to search a folder for Excel files and bring them into a table on the server. I also need to add a SheetName field as well as a FileName field. These 2 fields are ready […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |