Viewing 15 posts - 676 through 690 (of 2,171 total)
SELECTNode.value('../@ID', 'int') AS ServiceLineNumber,
Node.value('@Name', 'varchar(50)') as FieldName,
Node.query('New').value('.','varchar(100)') AS OldValue,
Node.query('Old').value('.','varchar(100)') AS NewValue
FROM@xml.nodes('/ServiceLine/Field') TempXML(Node)
October 2, 2008 at 2:54 am
SELECTagrNo,
SUM(CASE WHEN rowFlag = 'Y' THEN 1 ELSE 0 END) AS countOfY,
SUM(CASE WHEN rowFlag = 'N' THEN 1 ELSE 0 END) AS countOfN
FROMTable1
GROUP BYagrNo
October 1, 2008 at 12:24 am
I think he meant to answer this topic
http://www.sqlservercentral.com/Forums/Topic576550-149-1.aspx
but managed to start a new topic with new name.
September 26, 2008 at 8:39 am
Yes it is.
1 is "other value than 0".
September 26, 2008 at 8:20 am
Same suggesetion as I posted here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=111457
CREATE TABLE#Stage
(
{same structure as "linked" tables}
)
INSERT #Stage SELECT * FROM DB1.dbo.table1
INSERT #Stage SELECT * FROM DB2.dbo.table1
INSERT #Stage SELECT * FROM DB3.dbo.table1
INSERT #Stage SELECT * FROM...
September 26, 2008 at 6:49 am
DECLARE@Value DECIMAL(28, 6)
SET@Value = 26.153875
SELECT@Value AS OriginalValue,
ROUND(@Value, 4, 0) AS Rounding,
ROUND(@Value, 4, 1) AS Truncating
September 26, 2008 at 6:45 am
SELECT TOP 5userName,
clientID,
userID,
CONVERT(CHAR(10), reportDate, 101) AS reportDate
FROM(
SELECTu.userName,
c.clientID,
ua.uID AS userID,
ua.reportDate,
ROW_NUMBER() OVER (PARTITION BY u.uID ORDER BY ua.reportDate DESC) AS RecID
FROMClients AS c
INNER JOINUsers AS u ON u.clientID = c.clientID
INNER JOINUserActivityLog AS...
September 26, 2008 at 2:00 am
if you insert 20 lakh (2 million) records, it can be faster to drop existing indexes before insert, and recreate the indexes after insert.
September 26, 2008 at 1:16 am
Bulk insert or BCP are the fastest way to get 1 million (10 lakh) records into the database with minimal logging.
September 26, 2008 at 12:45 am
Something similar to this?
CREATE TRIGGER dbo.trgMyTotalUpdate ON dbo.MyTable
AFTER UPDATE
AS
IF UPDATE(Quantity)
UPDATEmt
SETmt.Total = i.Quantity * i.Price
FROMdbo.MyTable AS mt
INNER JOINinserted AS i ON i.PkCol = mt.PkCol
September 25, 2008 at 12:41 am
A datetime2 can hold values from 0001-01-01 00:00:00.0000000 through 9999-12-31 23:59:59.9999999
See the 7 decimals?
September 24, 2008 at 2:33 pm
DateTime2 ?
September 24, 2008 at 1:52 pm
Viewing 15 posts - 676 through 690 (of 2,171 total)