Viewing 15 posts - 961 through 975 (of 3,489 total)
Something like (make a backup of the table or wrap the update in a transaction so you can roll it back...)
UPDATE EmployeeTable
SET EMailAddress = otherTable.EMail
WHERE EmployeeTable.FieldX = OtherTable.FieldY
Basically, you do...
May 3, 2019 at 7:25 pm
If you have only one value per month, then you can use LAG([Inventory],1) OVER (ORDER BY DateArchived) AS PrevValue
and then compare. Maybe easier to do it in T-SQL.
May 1, 2019 at 4:53 pm
Use a Calendar table maybe?
April 30, 2019 at 11:12 pm
Maybe this will help?
You could use multiple REPLACE functions
use tempdb;
go
CREATE TABLE TheReplacements(
Search_Value VARCHAR(15) PRIMARY KEY
, Replace_Value VARCHAR(15) NOT NULL
);
GO
INSERT INTO TheReplacements (Search_Value, Replace_Value)
VALUES ('Timothy','Tim'),('Kathleen','Kathy'),('Joseph','Joe'),('Michael','Mike');
CREATE TABLE People (
PersonID...
April 29, 2019 at 9:40 pm
Oh! I knew it had to be easier than I was making it!
April 29, 2019 at 4:52 pm
For grins, I wrote this in VB.NET (well, sort of)
Public Function FormattedDate (ByVal dtInputDate As Date, ByVal blnShort As Boolean) As String
Dim m As Byte
Dim...
April 27, 2019 at 6:40 am
From what I've read, Language is a report-wide setting. So the only way I could think of doing it is to use either SWITCH or a lookup.
I sort of got...
April 27, 2019 at 4:53 am
If these are EDI files, then you can't just import them. You have to parse those, because the different lines have different meanings/information. Do they have a consistent structure?
April 26, 2019 at 10:19 pm
the one upside to certification is that it may cover things you might otherwise miss. On the other hand, be aware that they don't cover everything. (Damned if you, damned...
April 26, 2019 at 10:15 pm
Depends on what you mean by "closest". If it doesn't matter if it's over or under, you could use
ABS(DATEDIFF(...))
April 26, 2019 at 6:41 pm
Why do you have 4 columns that, in theory, contain potential duplicates and lots of nulls? Either I'm missing something, or this is a nonsensical question.
April 23, 2019 at 12:28 am
Run this and try it again:
use master;
go
ALTER AUTHORIZATION ON DATABASE::AdventureWorksDW2016 TO [ComputerName\InstanceName];
April 22, 2019 at 6:52 am
I had a Visio license for 2000 version (it as a long time ago!) and it could reverse engineer databases. That would work, but it would be really nice to...
April 21, 2019 at 10:34 pm
Didn't Lowell Aguirre post something on using gmail for this? I think it was several years ago, but should still be applicable.
April 19, 2019 at 7:31 pm
(Why can't I edit my original response? Hmm...)
Here's the article:
https://www.sqlservercentral.com/articles/tally-oh-an-improved-sql-8k-“csv-splitter”-function
SELECT test.SomeID, test.SomeValue, split.ItemNumber, Item = QUOTENAME(split.Item,'"')
FROM #JBMTest test
CROSS APPLY dbo.DelimitedSplit8k(test.SomeValue,',') split
WHERE split.ItemNumber = 4;
April 18, 2019 at 1:12 am
Viewing 15 posts - 961 through 975 (of 3,489 total)