Viewing 15 posts - 2,161 through 2,175 (of 3,543 total)
Is the error
Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object
or
Cannot insert duplicate key row in object
If it is the latter then the error is probably due to...
October 11, 2005 at 2:31 am
How about this for a start
SELECT [Year],[Qtr],SUM([value]) AS [value]
FROM (SELECT [Year],DATEPART(quarter,[Date])+1 AS [Qtr],[value]
FROM
WHERE [Month] < 10
UNION
SELECT [Year]+1,1 as [Qtr],[value]
WHERE [Month] >= 10
FROM...
October 10, 2005 at 7:17 am
I'd guess that
@FullName exists in Users
but
@username does not exists in [Employees]
October 10, 2005 at 6:48 am
![]() | How do you setup the excel file (details please)? |
Unless that is is a rhetorical question
October 6, 2005 at 7:19 am
This is what I would do in this order
Run BCP out to genrate bcp.fmt file
Edit bcp.fmt and remove unwanted columns
Put the columns into the sequence of the input file (cut...
October 5, 2005 at 7:45 am
Try this
DECLARE @startdate datetime
SET @startdate = '20050901'
SELECT @startdate+n.number,DATEPART(dw,@startdate+n.number),
DATENAME(dw,@startdate+n.number) AS [Date],
SUM(ISNULL(t.ThisPeriod,0)) AS [ThisPeriod],
SUM(ISNULL(l.LastPeriod,0)) AS [LastPeriod]
FROM master.dbo.spt_values n
LEFT OUTER JOIN
(SELECT DATEPART(dw,ot.dtStamp) AS [dayno],SUM(ot.OrderNet)...
October 5, 2005 at 7:29 am
![]() | have 10 district each have say 1 million school's(i have taken this school district as just an example... |
October 4, 2005 at 7:40 am
DATEADD(minute,SUM(DATEDIFF(minute,0,CAST(REPLACE(CAST([timecol] as varchar),'.',':') as smalldatetime))),0)
This will give you datetime value which you can then process, cast or convert as necessary
October 4, 2005 at 7:17 am
Not exactly true.
You can use GETDATE() as a parameter to a Scalar Function
but not as a paramenter to an Inline Table-valued Function
October 3, 2005 at 9:34 am
Providing the excel file exists
INSERT INTO
OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\temp\book1.xls', [sheet1$])
(col1,col2,col3)
SELECT col1,col2,col3 FROM
October 3, 2005 at 7:27 am
As parameters to functions can only be parameters or constants, the cast statement is neither.
Do as Kenneth suggests or change the input to the function to int
Create Function dbo.Pledge_Match(@campaign_year int) ...
and use
Select *...
October 3, 2005 at 7:19 am
Your query will return the results posted with the data you posted.
What do you mean by not working?
Check what is being returned from the subqueries, if either of them return...
September 30, 2005 at 6:49 am
![]() | ...and who guillotined you ?! |
Well, sushila, half a pic is better than none
September 28, 2005 at 7:36 am
May sound silly but does the input exactly match the filenames including zero and oh, five and s etc
September 22, 2005 at 10:01 am
Put
ECHO Finished
after last xcopy and before :Finish label and see if the text 'Finished' appears in the miss.log
September 22, 2005 at 9:31 am
Viewing 15 posts - 2,161 through 2,175 (of 3,543 total)