Viewing 15 posts - 2,026 through 2,040 (of 8,731 total)
mister.magoo (10/20/2016)
October 20, 2016 at 8:18 am
Oh Magoo, you've done it again! 😀
That worked perfectly. Now I wonder what would they prefer, if the Powershell option or the bat file option.
Here's the ps1 final script .
param($dtsx...
October 20, 2016 at 7:38 am
Persisted computed columns only make sense when the computation is expensive or when an index is needed. If that's not the case, persisting the computed column makes little sense.
October 19, 2016 at 2:37 pm
Exactly what DesNorton mentioned. I just wanted to add something about the performance.
The FORMAT function has been proven to be very slow. It's up to 40 times slower that previous...
October 19, 2016 at 1:37 pm
Brandie Tarvin (10/19/2016)
I think the hyphens are the problem. That powershell might see them literally as a switch "notifier"...
October 19, 2016 at 12:41 pm
The article that I posted does exactly what you're asking, put the columns as rows. There's no magic way to do it without coding. Here's an example that might have...
October 19, 2016 at 11:33 am
Check the following article:
http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/
October 19, 2016 at 10:46 am
Can anyone help in a Powershell issue I'm having?
If I can't find a solution, I'll have to convince my lead to use bat files.
October 19, 2016 at 9:46 am
Add this to your stored procedure and keep a single call to the database instead of 3.
DECLARE @Bcp NVARCHAR(200);
SET @Bcp = N'bcp [St].[dbo].[TmpTNVINTRInfo] out "C:\tnvintrailer\tnvin_' + CONVERT(NCHAR(8), GETDATE(), 112 )...
October 19, 2016 at 8:06 am
What happens when you get a row from Spain? or Portugal? or any other country in Europe?
You need to create a Countries table to store that information and, preferably, a...
October 19, 2016 at 7:03 am
Manic Star (10/18/2016)
djj (10/18/2016)
Ed Wagner (10/18/2016)
whereisSQL? (10/18/2016)
Revenant (10/18/2016)
crookj (10/18/2016)
djj (10/18/2016)
Grumpy DBA (10/18/2016)
BWFC (10/18/2016)
CurrentCurrant
Food
Hungry
Hungary
Europe
Brexit
Vote
Drink
Martini
October 18, 2016 at 1:17 pm
I totally agree with Sean. The column should be a varchar as it's just a number to identify the employee. It could be an integer if it's an integer somewhere...
October 18, 2016 at 8:18 am
Something like this?
CREATE TABLE #tmp( output nvarchar(max));
INSERT INTO #tmp
--Change Path
EXEC xp_cmdshell 'dir C:\Users\lcazares\Documents\Statement.pdf /TC'; --Uses /TC for creation date
SELECT CAST( LEFT( output, 10) AS datetime)
FROM #tmp
WHERE output LIKE '[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]%';
DROP TABLE...
October 14, 2016 at 2:27 pm
Here's another option. It considers that the address can be identified by the first 8 characters. You can adjust that value.
SELECT *, LEFT( a.address, CHARINDEX( LEFT( a.address, 8), a.address, 2)...
October 14, 2016 at 2:18 pm
Here's an option, but it's not perfect as it won't get the first row because it's not completely duplicated.
WITH
E(n) AS(
SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)
),
E2(n) AS(
...
October 14, 2016 at 12:51 pm
Viewing 15 posts - 2,026 through 2,040 (of 8,731 total)