Viewing 15 posts - 1,441 through 1,455 (of 2,894 total)
1. the name of a table is a collective or plural noun because it models a set of entities. You just told us that your database has only one person!
Personally...
June 6, 2012 at 9:27 am
SELECT
T2.Line.value('(../../../../FirstName/text())[1]','VARCHAR(30)') as FirstName,
T2.Line.value('(../../../../LastName/text())[1]','VARCHAR(30)') as LastName,
T2.Line.value('(../../InvoiceNumber/text())[1]','VARCHAR(30)') as InvoiceNumber,
T2.Line.value('(../../InvoiceAmount/text())[1]','INT') as InvoiceAmount,
CAST(T2.Line.value('(../../InvoiceDate/text())[1]','VARCHAR(30)') AS DATETIME) as InvoiceDate,
T2.Line.value('(LineNumber/text())[1]','INT') as LineNumber,
T2.Line.value('(ChargeDescription/text())[1]','VARCHAR(30)') as ChargeDescription,
T2.Line.value('(LineAmount/text())[1]','INT') as LineAmount
FROM #xml_data
CROSS APPLY data.nodes('/Customer/InvoiceCollection/Invoice/InvoiceLineCollection/InvoiceLine') as T2(Line)
Please next time provide DDL...
June 6, 2012 at 9:06 am
how can I get the month and year of today ...
SELECT YEAR(GETDATE()), MONTH(GETDATE()), DATENAME(MONTH,GETDATE())
... and go back the past 12 months from the year month that is...
June 6, 2012 at 8:33 am
Try some MYSQL forum...
June 6, 2012 at 7:04 am
What is supposed to happen? What your expected result from executable?
June 6, 2012 at 7:02 am
I need 8 weeks * 7 days numbers (56), so I can go back up to 56 days (8 weeks) and find last 8 fridays.
This one can be replaced with...
May 31, 2012 at 10:05 am
kapfundestanley (5/31/2012)
update table2
set id=(select max(id) from table1)
where id=0.
It indicates it executed,but on checking no update happened.Out of curiosity what could be the cause of this?I repeated...
May 31, 2012 at 9:54 am
You do something very stupid here:
SELECT
'12/31/2011' as CloseDate,
'0' as CostBasis,
'09/30/2010' as OpenDate,
'1' as PortfolioBaseIDOrder,
'0' as Quantity,
'0' as RealizedGainLoss
from dbo.fRealizedGainLoss(@ReportData) r
If the result of dbo.fRealizedGainLoss(@ReportData) is 5 rows, you will get...
May 31, 2012 at 9:50 am
DECLARE @dt DATETIME
SET @dt = GETDATE()
;WITH rns56
AS
(
SELECT TOP 56 (ROW_NUMBER() OVER (ORDER BY c) - 1) * -1 rn
FROM (SELECT 1...
May 31, 2012 at 9:40 am
Effect of NOLOCK is the same as SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
It just individually applied to the table and query, while setting isolation level makes it for every...
May 31, 2012 at 9:15 am
The only place I ever used in a production code was loading data warehouse, where full control of data modifications was guaranteed: nothing could possibly make any change in a...
May 31, 2012 at 9:13 am
Jay Pete (5/31/2012)
anthony.green (5/31/2012)
DELETE FROM test1 WHERE col1 <= DATEADD(WEEK,-5,GETDATE())Will delete anything where col1 is 2012-04-26 (based on today) or less
Thanks Anthony.It Works.
Can we use DATEDIFF function?
Yes you can, but...
May 31, 2012 at 8:52 am
"How to" what?
Use SSIS? - BoL would be your first point
Use BCP? - BoL would be your first point
Writing the query? - Read this first: http://www.sqlservercentral.com/articles/Best+Practices/61537/ and...
May 31, 2012 at 6:28 am
Viewing 15 posts - 1,441 through 1,455 (of 2,894 total)