Viewing 15 posts - 5,431 through 5,445 (of 5,590 total)
select SUM(IsNull(s.Sales,0)) Sales,
s.[Type],
p.Period
from #Period p
LEFT OUTER JOIN #Sales...
April 24, 2009 at 11:25 am
I just tried it... you can't combine them.
April 24, 2009 at 11:18 am
Not sure what you're wanting.
Is the problem that the print statements (status messages) aren't coming back until the procedure is finished? If so, replace the print statements with the...
April 24, 2009 at 9:20 am
stuehler (4/23/2009)
Jeff and WayneS,Just wanted to thank you both for these fantastic solutions.
You're welcome
So, I guess the question is - which is the most efficient, and places the least stress...
April 24, 2009 at 9:06 am
Leave it to Jeff to find another way with less code.:rolleyes:
April 23, 2009 at 7:45 pm
anjana.maganti (4/23/2009)
i have made changes and deployed it to live server ad now i received a error like...
'A column insert or update conflicts with a...
April 23, 2009 at 4:53 pm
It sounds like you have quite a few of these columns, so I'd have to concur that using a FK to a new table of those acceptable values would be...
April 23, 2009 at 2:10 pm
something done on a different OS?
Windows uses CR+LF,
Mac uses one (CR?), Linux the other (LF?).
April 23, 2009 at 2:07 pm
Try this (you'll need to change the hard-coded path to your text file to import):
-- the final results end up in this table variable
declare @Import TABLE (
ID int,
...
April 23, 2009 at 1:52 pm
PaulB (4/23/2009)
... how about something like this?
insert into table2
select * from table1
except
select * from table2
This would work IF all of the columns are used to create the uniqueness. Usually,...
April 23, 2009 at 12:35 pm
That's the point. He turned his frustration into a positive. By pointing out an issue in a positive way, he has potentially opened the door for himself.
In the suggested reply,...
April 23, 2009 at 12:14 pm
-- build a CTE of the rows that need to be added (not already in Table2)
;with CTE AS
(
select column1, column2 from Table1 -- use the columns that determine uniqueness
EXCEPT
select...
April 23, 2009 at 12:06 pm
if exists (select 1 from DestinationTable where PKField(s) = value(s) from CSV)
insert into ErrorTable
else
insert into DestinationTable
April 23, 2009 at 11:24 am
I don't think so... I couldn't get a default or check constraint on the type. But, as shown, you can still implement those on the fields in your table.
April 23, 2009 at 11:02 am
I suggest you look at: http://msdn.microsoft.com/en-us/library/aa258277(SQL.80).aspx and http://msdn.microsoft.com/en-us/library/aa258242(SQL.80).aspx to get an idea of your specific storage requirements. Add up the storage requirements for all of the columns, and multiply by...
April 23, 2009 at 10:56 am
Viewing 15 posts - 5,431 through 5,445 (of 5,590 total)