Viewing 15 posts - 916 through 930 (of 5,356 total)
February 21, 2005 at 7:29 am
Have you try with STR() yet?
This works for me:
ALTER TABLE Orders ADD testME VARCHAR(30)
GO
USE NORTHWIND
GO
UPDATE Orders SET testME =
CONVERT(VARCHAR(10), OrderDate,101) +
' ' +
STR(Freight,2 ) FROM Orders WHERE OrderDate...
February 21, 2005 at 7:19 am
Who knows?
What is a "high insertion rate"? for you? How will this happen? The simple number of rows is quite handable.
February 21, 2005 at 4:42 am
I'm sure you have pretty good reasons for this intentional denormalization, don't you?
Anyway, as Remi already mentioned, if you don't care about truncation...
February 21, 2005 at 2:40 am
Okay, another variation:
SELECT
DATEADD(MONTH,DATEDIFF(MONTH,30,GETDATE()),0) FirstDay
, DATEADD(MONTH,DATEDIFF(MONTH,30,GETDATE()),30) LastDay
February 21, 2005 at 2:19 am
Interestingly you need to check BOL for IDENT_CURRENT to find out, why SCOPE_IDENTITY() is mostly preferable to @@IDENTITY
February 21, 2005 at 2:11 am
A great place to start is to read Brian Kelley's article on that topic:
http://www.sqlservercentral.com/columnists/bkelley/allarticles.asp or visit http://www.sqlsecurity.com
Here are some more links:
http://msdn.microsoft.com/msdnmag/issues/04/09/SQLInjection/
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sp3sec03.mspx
February 21, 2005 at 2:10 am
That will most likely be the day I stop using SQL Server and make the move to Oracle.
...
where
T1.Key *= T2. Key and
T1,Key *= T3. Key.
Do a search in any SQL...
February 21, 2005 at 1:57 am
I don't think this is undocumented. This technique is called aggregate concatenation and widely used. However, there do exists problems with it which are described here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;287515
February 18, 2005 at 7:38 am
Please pass on the exact query for it
I'll leave a bit of work for yourself, okay?
Either try searching the site here for some...
February 18, 2005 at 5:53 am
Have you tried truncating the child tables first and then the parents?
February 18, 2005 at 5:51 am
Aargh, sometimes you can't see the wood for the trees:
SELECT
t1.location
, RIGHT(STUFF(CONVERT(CHAR(22),t1.EntryDate,13),21,4,' '),9)
, CASE
WHEN DATEDIFF(mi,t1.EntryDate,t2.EntryDate)>1440
THEN DATEDIFF(mi,t1.EntryDate,t2.EntryDate)-1440
ELSE DATEDIFF(mi,t1.EntryDate,t2.EntryDate)
END
FROM
#test t1
JOIN
#test t2
ON
t1.location = t2.location
AND
t1.EntryDate <...
February 18, 2005 at 5:48 am
Actually it's no question of if, but rather when MS will discontinue. See if this helps explaining: http://www.microsoft.com/sql/techinfo/tips/development/July23.asp
February 18, 2005 at 4:59 am
May I add that this might turn out a phantastic occasion to explore the collected wisdom of the SQL Server Books Online (aka BOL, aka the online manual)?
Never mind.
February 18, 2005 at 4:13 am
FWIW. Note the CASE expression to take care of period greater than 1 day:
IF OBJECT_ID('#test')>0
DROP TABLE #test
GO
SET NOCOUNT ON
CREATE TABLE #test
(
ENTRYDATE DATETIME
, [name] VARCHAR(10)
, Location INT
)
INSERT INTO #test VALUES('2005-01-01 10:00:00', 'Customer1',...
February 18, 2005 at 2:39 am
Viewing 15 posts - 916 through 930 (of 5,356 total)