Viewing 15 posts - 961 through 975 (of 3,480 total)
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
Use DelimitedSplit8K() and then specify the item# you want to return?
Jeff Moden wrote an article about splitting strings and included a UDF to do it. It returns (Value, Position) so...
April 18, 2019 at 12:21 am
Like this?
use tempdb;
GO
-- Now i want to order the KEY Column in products table
use tempdb;
GO
-- Now i want to order the KEY Column in products table
CREATE TABLE...
April 15, 2019 at 4:04 am
Can you post real table definitions (even partial)? It's impossible to answer your question with the current level of detail.
April 11, 2019 at 10:51 pm
Maybe this article will help.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
April 10, 2019 at 5:12 pm
Why not use Jeff Moden's DelimitedSplit8K? It returns an Item and the Item's ordinal position. Then you could just insert that into your final table.
Got any sample data for us...
April 9, 2019 at 6:22 pm
If you grant users execute rights on the schema, then they can access the objects inside it. What are you trying to accomplish by doing this?
April 7, 2019 at 9:55 pm
Grrr… Can't I edit my posts anymore?
I think the problem I'm having is that I can't get SQL Server to do a case-sensitive search. Not sure what I'm doing wrong.
SELECT...
April 2, 2019 at 6:48 am
Did you try using LAG()?
April 2, 2019 at 5:44 am
Another weird thing... What's up with the way this version of the forum software counts responses? It looks like it's counting messages in the thread and not responses. In the...
April 2, 2019 at 4:07 am
Viewing 15 posts - 961 through 975 (of 3,480 total)