This is probably UNIX timestamp. Try:
select dateadd(ss, 1190286440, '1970' )
------
chemistry - the only natural science that can be broken down into the categories a) making drugs and b) blowing stuff up
[banghead]
This update query does not have subqueries. Therefore it is not DIRECTLY responsible for error you get. Give us trigger code.
------
chemistry - the only natural science that can be broken down into the categories a) making drugs and b) blowing stuff up
[banghead]
Can you simply leave identity at (1, 1), then do this:
--Run the import.
INSERT INTO SDE._SMDBA_._COMPANY_ (Sequence, CODE, NAME)
SELECT NewSeq [!]+ @Seq - 1[/!], CompanyID, CompanyName
FROM @tmpMU
?
------
chemistry - the only natural science that can be broken down into the...
That should do it, assuming server language is set to US/UK English:
select ID, max(convert(datetime, left([Month], 3)+' 01, '+ convert(varchar(4), [Year]), 107)) as newestDate
from yourtable
group by ID
Newest dates per ID are represented as datetime values containing first day of month...
try sp_helptext <sprocname|triggername>
Or use Script Object to New Window As... Alter option in QA.
------
chemistry - the only natural science that can be broken down into the categories a) making drugs and b) blowing stuff up
[banghead]
Yes, methods using HAVING() aren't 100% safe...
Is there any way to do it without self-join?
------
chemistry - the only natural science that can be broken down into the categories a) making drugs and b) blowing stuff up
[banghead]
Mhm.... maybe:
select trackid
from blah
group by trackid
having sum(endAt-beginAt) <> max(endAt) - min(beginAt)
------
chemistry - the only natural science that can be broken down into the categories a) making drugs and b) blowing stuff up
[banghead]
Don't forget donutman [cook]. I learned a lot too...
OK, will try to participate - at least in more interesting topics. And maybe finally start that blog-like website of mine, lol.
------
chemistry - the only natural science that can be broken down into the categories a) making drugs and b)...
If uncommitted reads won't screw up web app business logic then try NOLOCK hint on SELECT statement.
Otherwise - speed up UPDATE. :-)
------
chemistry - the only natural science that can be broken down into the categories a) making drugs and b) blowing stuff up
[banghead]
My SQL skillz are very rusty last few months... anyway, here is one approach:
1. Find all dates where intervals begin
2. Rank these dates
3. Find all dates where intervals end
4. Rank these dates
5. Join 2) and 4) on rank value
I guess ID is partitioning value so... sample data:
create table...
Safety measures, safety measures...
While I was joking, this pretty much summarizes my opinion/experience about Oracle. Engine - kewl, tools - cranky, the rest - politics. Sortof.
------
chemistry - the only natural science that can be broken down into the categories a) making drugs and b)...
What is that Oracle thing anyway? Something from Matrix?
(j/k)
Gimme Oracle engine and PL/SQL and I'm happy. Gimme Oracle tools and I'll curse 24/7/52. Gimme consultant preaching about Oracle and I'll put him into spaceship with sublight engines and direct towards nearest massive black hole...
IIRC ror some reason this option is disabled but UDF debugging capability exists. Just call it from a stored procedure, debug that sproc then do "Step Into" thing on a line containing UDF call.
------
<this is sig>
select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')
</this...
Can you stop server, run it manually from command prompt with correct parameters, then use EM to fix bad ones?
------
<this is sig>
select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')
</this is sig>
[banghead]
Arguably the most trivial one:
open recordset
Do While not rs.Eof
do something
forget rs.moveNext
Loop
Then you restart IIS, kill VB program or whatever :P That's why some people write methods/functions a la nextRecord() doing skip & retrieval all at once, as seen in PHP.
Another example of...
Yup:
select *
from information_schema.key_column_usage
where table_name = 'tablename'
and constraint_name in
( select constraint_name
from information_schema.table_constraints
where constraint_type in ('UNIQUE')
)
Wanna include primary keys as well, add [!],'PRIMARY KEY'[/!] after...
Hm...
Variable prefixes a la 'li_', 'ls_' etc (scope + datatype + underscore) are typical for Sybase programmers who did a lots of PowerBuilder stuff.
LENGTH() is not supported by Sybase ASE (Adaptive Server Enterprise).
So... gotta be Sybase ASA = former Sybase SQLAnywhere = former Watcom...
About first query... the big one?
Get rid of T-SQL joins.
For max. performance don't use UDF - in this case simple CONVERT() with format 101 should do fine.
Replace MIN()/MAX() subqueries with derived table and left outer join.
And in very first query ORDER BY is meaningless... unless I missed...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.