Viewing 15 posts - 31 through 45 (of 65 total)
This is using the PIVOT operator. Case statements can also work and sometimes perform better.
SELECT *
FROM (SELECT RowNum = Row_number()
...
July 10, 2014 at 5:59 pm
I would probably try this way first. But other options exist.
INSERT INTO t1(SocialSecurityNumber)
SELECT SocialSecurityNumber
FROM t2
WHERE NOT EXISTS (SELECT 1
FROM t1
WHERE t1.SocialSecurityNumber = t2.SocialSecurityNumber
)
July 9, 2014 at 7:23 pm
I was able to get this to dynamically insert CSV file into 4 of my local DB's.
I am not sure where you error is but.
1. Set your "Connection Manager" Expression...
June 26, 2014 at 9:37 pm
One thing I have noticed recently is TSQL is not the best tool to use when it comes to XML. C# is far more efficient at searching and returning...
June 20, 2014 at 6:45 pm
If the issue is with the result set being returned to the screen there is an option to increase this size in SSMS
Options --> Query Results --> SQL Server...
June 20, 2014 at 6:07 pm
I remember when I first starting working with SQL Server, it was SQL Server 2000. We had a job that would restore the database to another environment and if...
May 9, 2014 at 7:01 pm
Steve Jones is generally speaking on track with what he said. Having spent 15 years in management roles and 35 years in technical roles I can say I have seen...
May 7, 2014 at 8:16 pm
Great post eric.notheisen this is dead on. Companies promote there Tech Superstars because there is no where else they can go for salary increase. This can be good/bad...
May 7, 2014 at 8:12 pm
I am not sure what the "new code" added means. This returns exactly same set as Sean but using PIVOT. Just a different approach. I compared the two...
November 13, 2013 at 3:18 pm
Monster Maghoul thank you for sharing! This is awesome now I just need to understand what is going on here. This guy will perform well under load too!
November 1, 2013 at 7:54 pm
Here is my shot at this using Mark-101232 derived table for times.
--use any database which has this numbers table.
declare @t as table (ptr int identity, START time, ENDD time)
...
November 1, 2013 at 7:04 pm
Here is what I found. Thanks opc.three!
Using Service broker (SQL Server) to call a WCF service which could add data to the queue. There are tables related to the...
October 30, 2013 at 11:03 pm
Hey opc.three,
Yes that is something I am looking at now to see how it can be leveraged. We are not only a sql server shop, but perhaps adding to...
October 30, 2013 at 10:42 pm
Hello all,
Actually in my current company we do have SSIS packages that call a API to update/insert data.
I am a DB Dev and did use SSIS package to call web...
October 30, 2013 at 10:29 pm
Something like this might work. I used a CASE here but PIVOT would also work.
IF object_id('dbo.vendor', 'u') IS NOT NULL
DROP TABLE vendor
GO
CREATE TABLE dbo.vendor (
item_id VARCHAR(10)
,tag VARCHAR(10)
)
INSERT...
July 30, 2013 at 10:43 pm
Viewing 15 posts - 31 through 45 (of 65 total)