Viewing 15 posts - 181 through 195 (of 287 total)
Try a CASE statement insead?create proc usp_Fact
@entFact smallint
as
SELECT
fac.c_fact_desc AS Service,
SUM(CASE WHEN ods.c_prv_cve = '005' THEN 1 ELSE 0 END) AS Prov,
CASE
WHEN @entFact = 1...
September 1, 2009 at 4:05 pm
Gianluca Sartori (9/1/2009)
Do it on the application side, you don't need to do it in SQL.
Totally agree.
However, if you insist on doing it in SQL you can do it in...
September 1, 2009 at 1:45 pm
mish (8/12/2009)
So does MS SQL have a TOP command then similar to the LIMIT in mySQL?
MS SQL does have a TOP command. However, it does not have a LIMIT command....
August 12, 2009 at 1:33 pm
AFCC Inc. Com (8/10/2009)
Yes,The line item in the OrderDetail table on column ProductID can represent either the FK_ from the utbQuote table or the utbProduct table.
The OrderDetial.ProductID should be a...
August 11, 2009 at 5:20 pm
The primary differnce is the way the data is stored single-byte versus double-byte.
It just so happens that the checksum algorithmn generates duplicates in this particular case.
August 5, 2009 at 4:18 pm
I never had good luck with the RAND() function. I'd suggest using NEWID() for generating random data.
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/04/04/populating-sample-data.aspx
For example:SELECT ABS(CHECKSUM(NEWID())) % 10000 as IntegerVal
August 4, 2009 at 11:52 am
Naw, probably not much different than doing a junk log.
My thought was that it seemed like good form to wrap it in a try-catch. Then if,in the future we ever...
August 3, 2009 at 11:16 am
This works for the sample data, but that might just be luck.. 🙂SELECT
*,
ROW_NUMBER() OVER (PARTITION BY R1, cancellation ORDER BY Date) AS
FROM
(
SELECT
*,
ROW_NUMBER() OVER (ORDER BY [Date])
- ROW_NUMBER() OVER...
July 31, 2009 at 12:43 pm
can you elaborate on this part? I don't understand the business rules:
need to get to records per policy number based on
--if they baded the preimium for peronal_property, if it...
July 31, 2009 at 11:58 am
What happens when you run this:BEGIN TRY
DECLARE @sql VARCHAR(4000)
SET @sql = 'bulk insert flibbityflooo
...
July 30, 2009 at 1:56 pm
I suspect that the SQL devs wanted a way to do bad things like allocate lots of memory and never let it go to see how long the server would...
July 29, 2009 at 3:40 pm
There are tons of ways to handle errors.. Personally I do not use the XACT_STATE. That doens't mean it isn't valuable. But, I guess that might depend on the complexity...
July 29, 2009 at 12:11 pm
How do you define "First" from the 21_view_po_line_schedule table?
This might help guide you..?
SELECT
inv_mast.item_id,
inv_mast.item_desc,
inv_loc.stockable,
inv_loc.qty_on_hand,
inv_loc.qty_backordered,
inv_loc.location_id,
p21_view_po_line_schedule.release_date,
p21_view_po_line_schedule.release_qty,
p21_view_po_line_schedule.qty_received
FROM
inv_loc
INNER JOIN inv_mast
ON inv_mast.inv_mast_uid = inv_loc.inv_mast_uid
INNER JOIN p21_view_po_line
ON inv_loc.inv_mast_uid = p21_view_po_line.inv_mast_uid
INNER JOIN
(
SELECT TOP 1
release_date,
release_qty,
qty_received,...
July 28, 2009 at 5:12 pm
Humm.. it seems to be working for me:BEGIN TRY
DECLARE @sql VARCHAR(4000)
SET @sql = 'bulk insert users
from ''C:\Documents and Settings\jdgonzalez\Desktop\users_mod.txt''
with (firstrow...
July 28, 2009 at 3:35 pm
As far as I know you cannot directly trap a terminal error. SSIS is probably a better bet.
However, I did find a post about nesting stored procs to capture...
July 28, 2009 at 2:10 pm
Viewing 15 posts - 181 through 195 (of 287 total)