Viewing 15 posts - 2,296 through 2,310 (of 2,462 total)
SQLWannabe (2/25/2013)
Holy cr@p, that's exactly what I want.
I didn't even think about the collation.
So since my collation is: SQL_Latin1_General_CP1_CI_AS, I need to change the collation?
Can you give me...
-- Itzik Ben-Gan 2001
February 25, 2013 at 12:06 pm
I started my technical career working on mainframes and switched to a database support role. Since then I have worked in the data world as a DBA, SQL Developer and...
-- Itzik Ben-Gan 2001
February 13, 2013 at 4:48 pm
Using the sample code I created before you can also get days in/days not in using this:
DECLARE @startdate bigint=20121101,
@endDate bigint=20121130;
;WITH
notthere AS
(SELECTStudentID, COUNT(*) AS DaysAbs
FROM #x
WHERE DateID>=@startdate AND DateID<=@endDate
AND...
-- Itzik Ben-Gan 2001
February 5, 2013 at 2:42 pm
This should do the trick:
-- Setup
IF OBJECT_ID('tempdb..#x') IS NOT NULL
DROP TABLE #x;
CREATE TABLE #x
( Studentid int, DateID bigint unique, attendaceind bit)
INSERT INTO #x
SELECT 1234, 20121031, 1 UNION ALL
SELECT...
-- Itzik Ben-Gan 2001
February 5, 2013 at 2:29 pm
DBA12345 (2/5/2013)
Thanks alot...I appreciate your help
NP
-- Itzik Ben-Gan 2001
February 5, 2013 at 1:49 pm
This should do the trick:
--Setup
IF OBJECT_ID('tempdb..#t1') IS NOT NULL
DROP TABLE #t1;
IF OBJECT_ID('tempdb..#t2') IS NOT NULL
DROP TABLE #t2;
CREATE TABLE #t1 ([Server] varchar(10) primary key,
[Name] varchar(10) NOT NULL,
...
-- Itzik Ben-Gan 2001
February 5, 2013 at 1:11 pm
Jeff Moden (1/10/2013)
Alan.B (1/10/2013)
This morning before work for example, after a lot of effort, I finally figured out how to get the Levenshtein Edit Distance between 2 strings without a...
-- Itzik Ben-Gan 2001
January 14, 2013 at 9:36 am
Greg Snidow (1/11/2013)
Alan.B
I came up with this:
-- strings to compare
DECLARE@s1 varchar(8000)='diner',
@s2 varchar(8000)='dinerr';
DECLARE @ld int=ABS(LEN(@s1)-LEN(@s2));
IF ((@s1=@s2) OR ((ISNULL(LEN(@s1)*LEN(@s2),0)=0))) BEGIN GOTO LD END;
DECLARE@minlen int=CASE WHEN LEN(@s1)>LEN(@s2) THEN LEN(@s2) ELSE LEN(@s1) END;
;WITH...
-- Itzik Ben-Gan 2001
January 14, 2013 at 9:11 am
soni321 (1/10/2013)
-- Itzik Ben-Gan 2001
January 10, 2013 at 3:07 pm
Based on what you are saying I think you mean SP1 (Service Pack1)... And is this SQL Server 2012 Express?
You may just need to run Service Pack 1.
What...
-- Itzik Ben-Gan 2001
January 10, 2013 at 2:57 pm
What's the error?
-- Itzik Ben-Gan 2001
January 10, 2013 at 2:50 pm
Sean Lange (1/10/2013)
Alan.B (1/10/2013)
-- Itzik Ben-Gan 2001
January 10, 2013 at 1:32 pm
Jeff Moden (1/9/2013)
Alan.B (1/9/2013)
AndrewSQLDBA (1/9/2013)
Its worth noting that the following is sargable.LIKE '%abc%'
Did you mean "NOT" SARGable because it sure doesn't look SARGable from here. 😉 And,...
-- Itzik Ben-Gan 2001
January 10, 2013 at 12:19 pm
dwain.c (1/9/2013)
I would recommend, however that you change the way you construct your asciichar table:
;WITH asciichar(n, c) AS (
SELECT n=64+number, CHAR(64+number)
FROM [master].dbo.spt_values...
-- Itzik Ben-Gan 2001
January 10, 2013 at 11:59 am
My appologies. In my last post I misread your question. Hopefully what GSquared posted helped.
-- Itzik Ben-Gan 2001
January 10, 2013 at 10:51 am
Viewing 15 posts - 2,296 through 2,310 (of 2,462 total)