Viewing 15 posts - 1,951 through 1,965 (of 2,894 total)
You don't need NTILE...
-- create sample table
select top 1000 4441 as groupnumber , cast(null as bit) statusbit
into #t
from syscolumns
-- update
;with cte
as
(
select *,(ROW_NUMBER() OVER (ORDER BY groupnumber)-1) % 5 ...
March 12, 2012 at 6:10 am
siva 20997 (3/12/2012)
Wheather the code is inLine or...
March 12, 2012 at 6:00 am
siva 20997 (3/12/2012)
Would like to know if there is lot of differnce in the perfomance bitween
User Defined Functions (like what I have posted)
and system defined functions like DateAdd and...
March 12, 2012 at 5:26 am
ard5karthick (3/12/2012)
Generally Uniqueidentifier is a 36 bit alphanumeric unique Value that will not be duplicated.
Its syntax is XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
It is a data type in SQLServer & it will be mostly used...
March 12, 2012 at 5:18 am
oops, didn't see the thread end...
But still, want to mention that it's not a good idea to use scalar-values user defined SQL function for doing it.
In-line-sql, may look a...
March 12, 2012 at 4:51 am
opc.three (3/9/2012)
Re: "you should try to make trigger as lightweight as possible"
I could not agree more, Eugene. Unfortunately your example will force a full scan of the inserted table...
March 12, 2012 at 4:44 am
ColdCoffee (3/8/2012)
But if u split the insert statements into 2 statements, it is going to give you...
March 9, 2012 at 3:43 am
opc.three (3/8/2012)
Now the example trigger:
IF EXISTS ( SELECT *
FROM sys.objects
...
March 9, 2012 at 3:35 am
Is it an interview question?
March 8, 2012 at 10:33 am
Gianluca Sartori (3/8/2012)
I would not rely on DATENAME.Try prefixing that code with SET LANGUAGE Italian:
L'impostazione della lingua รจ stata sostituita con Italiano.
-----------------------
2011-12-31 00:00:00.000
(1 row(s) affected)
I wouldn't too, if my database...
March 8, 2012 at 10:32 am
Beginner_2008 (3/8/2012)
I am not going to use the cursor.๐
Then, you may miss some updates!
There was a story remembered by some one here, about the company went bust because of...
March 8, 2012 at 10:20 am
March 8, 2012 at 10:08 am
declare @dt datetime
set @dt = '20120101'
SELECT DATEADD(DAY,
CASE DATENAME(WEEKDAY,DATEADD(DAY,-1,DATEADD(MONTH, DATEDIFF(MONTH,0,@dt),0)))
...
March 8, 2012 at 10:02 am
Looks like OP is not going to listen...
Ok, you can take this and kill yourself :hehe::
CREATE TRIGGER CustomerUpdateMail
ON customer_info
FOR UPDATE
AS
SET NOCOUNT ON;
declare @message nvarchar(2000);
DECLARE crsUpd CURSOR FAST_WORWARD
FOR...
March 8, 2012 at 9:43 am
Your code is fine to me, but you can use CTE to make it "look nice":
;with duplicates
as
(
select [name] from infosys
group by...
March 8, 2012 at 8:52 am
Viewing 15 posts - 1,951 through 1,965 (of 2,894 total)