Viewing 15 posts - 511 through 525 (of 1,923 total)
Going through the example again adding extra data, ( new sample has Name1 and name2 appearing 5 times each), here is the code
DECLARE @Table TABLE
( ColVal VARCHAR(10) )
INSERT INTO @Table...
February 18, 2012 at 4:42 pm
Jeff Moden (2/18/2012)
Although the execution plans are identical and the performance is likely identical, as well, sometimes the "old ways" lead to simpler code. Don't forget...
February 18, 2012 at 12:06 pm
Mind you, the above query works only if u have single value out of the table ; if u have multiple-qualifying rows, then we must use another method!
{Edit - Gosh,...
February 18, 2012 at 5:05 am
This?
DECLARE @Table TABLE
( ColVal VARCHAR(10) )
INSERT INTO @Table (ColVal)
SELECT 'name1'
UNION ALL SELECT 'name2'
UNION ALL SELECT 'name3'
UNION ALL SELECT 'name1'
UNION ALL...
February 18, 2012 at 5:01 am
Please follow this article and provide us more information on what you need.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 17, 2012 at 6:35 pm
Change select pid, CN, mk, te, yr, st, cr, cc from to select pid from
You cant throw multiple values values from a subquery while u use in WHERE clause....
February 17, 2012 at 5:44 pm
Jeremy... (2/17/2012)
"2012-01-01 10:12:03.090" vs "Jan 13 2012 2:20AM".Is there anyway for this to work while keeping dates looking the same?
This?
CASE WHEN (
SELECT MIN(dbo.GetLocalDateTimeFunc(FA2.ReceivedDate))
FROM FileActions FA2
WHERE FA2.ActionDefID...
February 17, 2012 at 5:27 pm
PaulB-TheOneAndOnly (2/17/2012)
Have you ever hammered a screw?
If the screw is tapered and should have a sharp point, then yes 😀
PaulB-TheOneAndOnly (2/17/2012)
it works but doesn't look professional, init?
Totally agree!
February 17, 2012 at 4:15 pm
PaulB-TheOneAndOnly (2/17/2012)
What tool would you use to screw togheter two pieces of wood? a hammer or a screwdriver?
Both the tools bond 2 pieces of wood.
I would ask "What...
February 17, 2012 at 3:40 pm
so your new code will be (changes in bold)
CASE WHEN (
SELECT MIN(dbo.GetLocalDateTimeFunc(FA2.ReceivedDate))
FROM FileActions FA2
WHERE FA2.ActionDefID IN (66,64,391) --Docs Sent To Record Actions
AND FA2.ReceivedDate IS NOT NULL
AND FA2.FileID = FM.FileID
...
February 17, 2012 at 1:57 pm
And read about data-type precedence here : MSDN
The values retruned by each expression in CASE will be matched will be converted to the highest data-type in the precedence list!
Thus...
February 17, 2012 at 1:53 pm
Run these following statements, you will know!!
select case when 1 = 1 then GETDATE()
when 2 =...
February 17, 2012 at 1:47 pm
Evil Kraig F (2/16/2012)
ColdCoffee (2/16/2012)
1. Create a new database in another server with only one table that matches your source table
2. BCP out data from your source table...
February 16, 2012 at 6:24 pm
How about this?
1. Create a new database in another server with only one table that matches your source table
2. BCP out data from your source table to a file
3. Copy...
February 16, 2012 at 5:44 pm
Viewing 15 posts - 511 through 525 (of 1,923 total)