Viewing 15 posts - 256 through 270 (of 444 total)
declare @1 datetime = '2015-01-13 00:00:00';
declare @2 datetime = '2015-01-14 03:00:00';
select datediff(dd,@1,@2) as days, datediff(hh,@1,@2) as hours
/* 1 27 */
Do you need 1 day or 24 hours?...
January 15, 2015 at 1:16 am
BOL says,
<joined_table> ::=
{
<table_source> <join_type> <table_source> ON <search_condition>
| <table_source> CROSS JOIN <table_source>
| left_table_source { CROSS...
January 14, 2015 at 2:39 am
I'd prefer SELECT TOP(1) ... ORDER BY too. If all rows with equal minimum value are requierd use WITH TIES option.
INSERT INTO dbo.TBL_SAMPLE_PRICE (ID,U_Price,FX,Rate)
VALUES
(1280,...
January 14, 2015 at 12:53 am
Aaron N. Cutshall (1/13/2015)
serg-52 (1/13/2015)
OK, may be just filter them in WHERE ?Unfortunately, that would filter out rows, not columns.
Yes, my understanding was you complaint just about excessive rows. If...
January 14, 2015 at 12:27 am
Aaron N. Cutshall (1/12/2015)
If the join to #ValueSet is made with a LEFT JOIN, then I do indeed get all records from #Element, but I also get those from #Property...
January 13, 2015 at 5:22 am
Although recursive ctes are known to have perfomance problems you may wish to try it as well. Having no joins it may perfom not so bad.
create table dbo.TBL_USERTEXT
(
...
January 12, 2015 at 5:03 am
I second Phil's suggestion.
Minor note, looks like
AND for any of the other mode fields = 2 or 3, all modes = 2 or 3 must have a mode_enddate that is...
January 6, 2015 at 12:28 pm
Jeff Moden (12/26/2014)
serg-52 (12/26/2014)
TrySelect Phone1,Phone2 from tblregistration
where 'abc@yahoo.com,def@yahoo.com,efg@yahoo.com' like '%'+Usernames+'%'
That could end up being a pretty bad performance problem because it's not SARGable. Guaranteed , if I'm reading...
December 26, 2014 at 1:03 pm
Try
Select Phone1,Phone2 from tblregistration
where 'abc@yahoo.com,def@yahoo.com,efg@yahoo.com' like '%'+Usernames+'%'
December 26, 2014 at 3:19 am
If [Qual] is not needed in the result set, just exclude it .
-- Query 1 and 2 combined
SELECT DISTINCT
StudentUID ,
...
December 24, 2014 at 1:43 am
Can you show the queries and what you mean 'itegrated dynamically'?
Dynamic Sql or something?
December 24, 2014 at 1:11 am
Note these two solutions aren't logically equivalent.
The one with explicit Order column allows to repeate a title in a playlist.
December 22, 2014 at 5:27 am
🙂 OK.
declare @x xml;
set @x = (SELECT * FROM OPENROWSET(BULK '<YOUR PATH ON SQL SERVER MACHINE>\rates.xml', SINGLE_CLOB) AS x);
with xmlnamespaces ('http://www.reuters.com/Rate' as rts)
select n1.a.value('fn:local-name(.)','varchar(20)') as rateType
,cast(left(n1.a.value ('./@Timestamp','varchar(20)'),8) as date )as...
December 22, 2014 at 5:12 am
To be able to add real offset value you need some additional source of data.
declare @off char(6) ='+04:30';
declare @src datetime = getdate(); -- source value
select convert(varchar(50),convert(datetimeoffset(0),convert(varchar(50), @src) + @off),126) as...
December 22, 2014 at 4:38 am
Having a table of parent nodes, n1(a), you can continue getting child nodes applying the same nodes() xml function to parent nodes. E.g.
with xmlnamespaces ('http://www.reuters.com/Rate' as rts)
select n1.a.value('fn:local-name(.)','varchar(20)') as rateType
,n1.a.value...
December 22, 2014 at 3:59 am
Viewing 15 posts - 256 through 270 (of 444 total)