Viewing 15 posts - 2,161 through 2,175 (of 3,544 total)
| Isn't there a problem in SQL Server where, in a stored proc, SQL statements that follow a RETURN... |
Far away is close at hand in the images of elsewhere.
Anon.
October 11, 2005 at 7:14 am
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
October 10, 2005 at 7:17 am
I'd guess that
@FullName exists in Users
but
@username does not exists in [Employees]
Far away is close at hand in the images of elsewhere.
Anon.
October 10, 2005 at 6:48 am
| How do you setup the excel file (details please)? |
Unless that is is a rhetorical question 
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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)...
Far away is close at hand in the images of elsewhere.
Anon.
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... |
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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 ![]()
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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 *...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
September 30, 2005 at 6:49 am
| ...and who guillotined you ?! |
Well, sushila, half a pic is better than none ![]()
Far away is close at hand in the images of elsewhere.
Anon.
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 ![]()
Far away is close at hand in the images of elsewhere.
Anon.
September 22, 2005 at 10:01 am
Viewing 15 posts - 2,161 through 2,175 (of 3,544 total)