Viewing 15 posts - 556 through 570 (of 2,171 total)
What datatype is ColD? Is it a computed column? Persisted?
December 22, 2008 at 6:19 am
Or use the new OUTPUT operator?
CREATE TRIGGERTR_YOURTABLE_STATUSCHANGED
ONYOURTABLE
AFTER UPDATE
AS
INSERTSomeStatusTable
(
STATUS,
FORMID,
DATECOMPLETED
)
OUTPUTi.INVOICEID,
i.FORMID,
GETDATE()
INTOShippingQueue
(
INVOICEID,
FORMID,
DATEQUEUED
)
SELECTi.STATUS,
i.FORMID,
GETDATE()
FROMINSERTED AS i
WHEREi.STATUS = 3
AND i.FORIMID = 6
December 22, 2008 at 6:16 am
--get next available id
UPDATE Ids SET @NewId = lastid = lastid+1 WHERE tablename ='EventLog'
if...
December 22, 2008 at 6:11 am
Maybe "beyond relational" should be read in the context "relational and more" ?
December 22, 2008 at 2:05 am
Better DateOnly and TimeOnly algorithms.
DECLARE@Sample DATETIME
SET@Sample = '2008-10-22 11:41:36.920'
SELECTDATEADD(DAY, DATEDIFF(DAY, 0, @Sample), 0) AS DateOnly,
DATEADD(DAY, DATEDIFF(DAY, @Sample, 0), @Sample) AS TimeOnly
December 22, 2008 at 1:54 am
DECLARE@Sample TABLE
(
pk INT,
dat VARCHAR(20)
)
INSERT@Sample
SELECT4, '1' UNION ALL
SELECT2, '00102' UNION ALL
SELECT6, '11' UNION ALL
SELECT1, '001' UNION ALL
SELECT3, '0102' UNION ALL
SELECT5, '100' UNION ALL
SELECT7, 'R00102'
-- Peso
SELECTpk,
dat
FROM@Sample
ORDER BYPATINDEX('%[^0]%', dat) DESC,
CASE
WHEN dat LIKE '%[^0-9]%'...
December 19, 2008 at 9:04 am
And what is the expected output based on your sample data?
December 19, 2008 at 8:39 am
Not even with SQL Profiler?
You can get every statement within the function there.
December 19, 2008 at 7:16 am
Sergey Kazachenko (12/19/2008)
The problem is, the import doesn't fail - it simply sticks the next line into the 6th column (which is sufficiently large).
It is a sign that the...
December 19, 2008 at 7:07 am
A solution for normalized tables would be
DECLARE@qh11 TABLE
(
Serial INT,
qh11 VARCHAR(1)
)
INSERT@qh11
SELECT1, '2' UNION ALL
SELECT1, '3' UNION ALL
SELECT1, '4' UNION ALL
SELECT1, '5' UNION ALL
SELECT1, '6' UNION ALL
SELECT1, '7' UNION ALL
SELECT1, '8' UNION...
December 19, 2008 at 6:03 am
A solution without use of auxiliary table such as a tally table is this
;WITH Yak (Serial, qh21, c, n)
AS (
SELECTSerial,
qh21,
SUBSTRING(qh21, 1, 1),
1
FROMIndus
UNION ALL
SELECTSerial,
qh21,
SUBSTRING(qh21, n + 1, 1),
n + 1
FROMYak
WHEREn <...
December 19, 2008 at 5:48 am
ONLINE = { ON | OFF }
Specifies whether underlying tables and associated indexes are available for queries and data modification during the index operation. The default is OFF.
Note: ...
December 19, 2008 at 5:30 am
I guess you could use the ONLINE hint, but it requires the Enterprise edition to work.
The ONLINE hint determines whether concurrent user access to the underlying table during operation.
See http://msdn.microsoft.com/en-us/library/ms186241(SQL.90).aspx
and...
December 19, 2008 at 5:23 am
Viewing 15 posts - 556 through 570 (of 2,171 total)