Viewing 15 posts - 1,291 through 1,305 (of 4,081 total)
You seem to be trying to turn columns into rows. Will one of the solutions below work for you?
declare @sample table ([product_id_1] int,
[scan_time__sec] int,
[focal_spot_mm] int,...
October 7, 2010 at 3:19 pm
Is that why my @@ARID value keeps changing?
October 7, 2010 at 9:44 am
Who are you?
Who sent you?
Why are you following us?
😛
October 7, 2010 at 9:43 am
As Grant would tell you, it's hard to know for sure without looking at an execution plan. Given an index on [createTimestamp ], the optimizer may be smart enough...
October 5, 2010 at 8:52 pm
Second Steve's sentiments about changing the structure of the table. Whether it's called an EAV or a MUCK, that design has been "invented" again and again over...
October 5, 2010 at 8:27 pm
Here we go, Jeff:
It is the CROSSTAB of UNPIVOTS
Is this what we're looking for?
declare @sample table (ID int identity(1,1), Column1 varchar(10), column2 varchar(10), column3 varchar(10))
insert into @sample
select 'row11', 'row12',...
October 5, 2010 at 5:43 pm
It would also be nice to know the volumes in each of the tables involved. What would really help would be an execution plan for this query,...
October 5, 2010 at 5:35 pm
This takes me back to childhood....
Q: Why did the elephant climb the tree?
A: To play with his friend, the rhino.
Q: Why did the elephant sit...
October 5, 2010 at 5:25 pm
The good news is that when you do parameterized dynamic SQL, it can take advantages of existing indexes and views, and even cache a query plan for future use by...
October 5, 2010 at 5:16 pm
Perhaps I'm not explaining clearly enough.
The comparison to the customer ID is hard coded in the WHERE clause. It has nothing to do...
October 5, 2010 at 1:38 pm
You're welcome Vishal. But looking at your "working" example, what you are doing isn't really dynamic SQL at all. You are assigning a...
October 5, 2010 at 1:14 pm
Agreed. Parameterized dynamic SQL using sp_executesql not only prevents SQL injection attacks, it also provides for execution plan caching.
October 5, 2010 at 1:02 pm
You can't "set a column name" without using dynamic SQL. You can use a CASE expression to choose between two column VALUES, but this could very well cause...
October 5, 2010 at 10:18 am
GilaMonster (10/4/2010)
CirquedeSQLeil (10/4/2010)
GilaMonster (10/4/2010)
Craig Farrell (10/4/2010)
Alvin Ramard (10/4/2010)
GilaMonster (10/4/2010)
October 4, 2010 at 11:45 pm
Viewing 15 posts - 1,291 through 1,305 (of 4,081 total)