Viewing 15 posts - 256 through 270 (of 2,462 total)
Jeff Moden's DelimitedSplit8K is the best in the business on pre-2012 systems and non-max data types; on SQL 2012+ I suggest DelimitedSplit8k_LEAD by Eirikur Eiriksson which is based...
-- Itzik Ben-Gan 2001
June 14, 2017 at 9:33 pm
-- Itzik Ben-Gan 2001
June 2, 2017 at 11:08 am
I learned something new today: # is a valid temp table name.
CREATE TABLE #(id int);
INSERT # VALUES (1);
SELECT * FROM #;
DROP TABLE...
-- Itzik Ben-Gan 2001
May 23, 2017 at 3:30 pm
-- Itzik Ben-Gan 2001
May 22, 2017 at 1:39 pm
I did this on my phone and cant test this but i think this is what you need.
With yourData (rn, Emp_ID, Hour_Type, Start_Date, Hours, End_Date
AS
(
...
-- Itzik Ben-Gan 2001
May 21, 2017 at 7:18 pm
First for some sample data
USE tempdb
GO
IF OBJECT_ID('tempdb.dbo.cannedPhrases') IS NOT NULL DROP TABLE dbo.CannedPhrases;
IF OBJECT_ID('tempdb.dbo.GS') IS NOT NULL DROP TABLE dbo.GS;
GO
-- Itzik Ben-Gan 2001
May 19, 2017 at 4:56 pm
Joe Celko
Please read a book on RDBMS. The identity column is not a column! It's a table property imposed by physical storage...
-- Itzik Ben-Gan 2001
May 18, 2017 at 3:25 pm
-- Itzik Ben-Gan 2001
May 17, 2017 at 3:57 pm
Without Execution plans (you can just post them here, BTW, using the "Add File" link below) it's impossible to determine why each query is performing differently. In SQL server 2014...
-- Itzik Ben-Gan 2001
May 17, 2017 at 3:50 pm
I posted this function about a year ago here. It takes for parameters:
@low = represents the lowest value for n1.
@high = represents the highest...
-- Itzik Ben-Gan 2001
May 16, 2017 at 9:05 am
-- Itzik Ben-Gan 2001
May 10, 2017 at 2:01 pm
Yes, SSIS is the best tool for this.
Depending on your SSIS skill level , you can also use the SQL Server Import/Export wizard (which uses SSIS). You would...
-- Itzik Ben-Gan 2001
May 10, 2017 at 1:35 pm
When moving need to perform insert/update based on primary key value.
This sounds like a job for MERGE to me; there's no need for a loop...
-- Itzik Ben-Gan 2001
May 9, 2017 at 12:27 pm
Well, if you have to use a function to strip the non-numeric characters then DigitsOnlyEE is the best way to go (something I was going to say until...
-- Itzik Ben-Gan 2001
May 8, 2017 at 4:47 pm
If Serv.ID is numeric then you would have to convert it to a string first: -- Itzik Ben-Gan 2001 Then 'Assessment' + ' - ' + CAST(Serv.ID AS varchar(10))
Or, my favorite, CONCAT:
May 4, 2017 at 5:58 pm
Viewing 15 posts - 256 through 270 (of 2,462 total)