Viewing 15 posts - 346 through 360 (of 367 total)
Try a free tool XDetails (www.sqlxdetails.com). It really simple presents multicolumn PK, FK, column comments and other features.
January 30, 2011 at 5:28 am
If you really have to...
split to one city, than rejoin them with less cities per row.
But I would not join them at all. I would leave one city per row.
Google...
January 27, 2011 at 7:29 am
Modulo was because smaller table has less rows than big table.
Lets say N = number of rows in the smaller table.
Smaller table is widened in subquery with random unique...
January 27, 2011 at 6:54 am
From the smaller table make a subquery widening it with a random ordinal number as shown in example before (row_number() over(order by newid()) construct).
If you have unique integer (maybe PK?)...
January 27, 2011 at 1:58 am
Why update? You could select exactly what you need and optionally store that via insert.
Update is a low performer.
Since you didn't specify what is random here, let's assume you have...
January 26, 2011 at 2:59 pm
Like Andrew said, it's a classic many-to-many relation. In logical data model you have two entities: A and B. One A can have (contains, is associated with, etc) multiple B's,...
January 26, 2011 at 2:02 pm
You could use SQL_VARIANT data type that can store any other base data type without conversion or lost precision:
DECLARE @x AS SQL_VARIANT, @y AS SQL_VARIANT, @t AS SQL_VARIANT
SELECT @x =...
January 26, 2011 at 12:31 pm
In this example full text index is very wrong solution.
You should store each value in separate table row and use a normal index.
Split function is here:
-- Create sysTally table
SELECT TOP...
January 26, 2011 at 12:02 pm
create procedure ErrorListGet
-- Returns comma-separated list of errors for given request
(@reqid int,
@Messages varchar(max) out
) as
begin
-- Bild comma-separated list of messages
-- If you want some particular order, simply add "order...
January 23, 2011 at 12:43 am
CASE in not complex at all.
I already wrote you description of what might be wrong.
You cannot use LEFT JOIN and then update right table - if there is no matched...
January 19, 2011 at 2:44 pm
tacy.highland (1/17/2011)
UPDATE BookingActivity
SET faretypeid =
CASE WHEN c.FareTypeId IN (9,10,11) THEN 4
ELSE faretypeid = b.FareTypeId
END
FROM Booking b
LEFT JOIN Clients c ON b.ClientID =...
January 18, 2011 at 1:19 pm
Lamprey13 stole me the word of mouth (or code from the keyboard) 😉
That code is the best IMHO. Think of this situation: If the code inside the try-block calls a...
January 11, 2011 at 3:11 pm
In short: no. You probably will not have significant performance gains if you use "mutant" CASE statement.
It's all about the megabytes that db engine needs to read to get you...
January 11, 2011 at 2:55 pm
This requires classic tuning procedure.
Collect few typical queries, and start with the one that is used the most.
Measure logical reads, eg. like this:
SET STATISTICS IO ON
SELECT * FROM sys.all_objects --...
January 5, 2011 at 6:08 am
Answer to your question is: yes, parallel execution of that procedure will give you the same control number.
In default transaction isolation level, transaction will not lock the selected row.
The key...
January 4, 2011 at 2:09 am
Viewing 15 posts - 346 through 360 (of 367 total)