Viewing 15 posts - 1 through 15 (of 287 total)
The Dixie Flatline (3/4/2014)
Lamprey13 (12/16/2010)
SELECT TOP 10 * FROM MyTable
WHERE 0.01 >= CAST(CHECKSUM(NEWID(),...
March 4, 2014 at 12:48 pm
just a small note. Which method you choose may depend on your environment. By that I mean some environments are more disk bound that CPU, some vice sera, etc.
If you...
March 4, 2014 at 12:16 pm
brettk (10/31/2013)
October 31, 2013 at 3:29 pm
If you are looking for performance in a bulk-update scenario, you might want to look into using a View with an Instead Of trigger. That way you can "bulk insert"...
October 31, 2013 at 3:19 pm
Forgot my sample:CASE
WHEN DATEPART(MM,OrderDate) = 12
THEN (APPT_RPT_APPOINTMENT.DURATION / 60)
ELSE NULL
END AS Decschedhours
March 20, 2013 at 11:46 am
If you are trying to generate a column, then you should probably use a CASE expression. An IF statement is used for flow control.
March 20, 2013 at 11:44 am
There is also the MERGE statement.
February 3, 2012 at 2:28 pm
Koen Verbeeck (12/22/2011)
It is perfectly acceptable to have a denormalized database design in a relational database, for example in a data warehouse. SQL still works, and it is still pretty...
December 22, 2011 at 3:29 pm
Yeah, GSquared solution won't work with your sampel data, that's why I posted an alternate solution.
Try this:SELECT *
FROM
(
SELECT...
December 20, 2011 at 2:07 pm
I'm not usre of your actual data since none was supplied, but if GSquared's solution doesn't work perhaps you can use this:
DECLARE @T1 TABLE (Col VARCHAR(2))
DECLARE @T2 TABLE (Col VARCHAR(2))
--INSERT...
December 20, 2011 at 12:23 pm
I'm not clear if you want to encrypt/decrypt a string or just convert it to binary. So, here is s way to to Cast to binary and back again:DECLARE @string...
December 20, 2011 at 11:33 am
I wouldn't explicitly covert a date to a string and then implicitly back to a date. Depending on your version of SQL you can use:SELECT
CAST(CURRENT_TIMESTAMP...
December 20, 2011 at 11:13 am
Bascially one (AS clause) is ISO compliant and the equal-sign is not. According to BOL:
The AS clause is the syntax defined in the ISO standard for assigning a name to...
December 20, 2011 at 11:08 am
I'd highly doubt it's a SQL issue, but there are several things that people do in SQL that could have unexpected consequences.
Using MERGE, for example, can have unexpected results given...
December 16, 2011 at 10:33 am
Are you just looking for the first and last day on the currnet month?
If so, maybe this will help:SELECT
DATEADD(MONTH, DATEDIFF(MONTH, 0, CURRENT_TIMESTAMP), 0),
...
December 13, 2011 at 1:43 pm
Viewing 15 posts - 1 through 15 (of 287 total)