Viewing 15 posts - 13,531 through 13,545 (of 15,381 total)
And if at all possible a little normalization would go a LONG way to making your life a lot easier. You need to spin off off several detail tables for...
November 10, 2011 at 10:40 am
You probably have more than 1 record for each ID. What are the counts in each of those tables for that ID?
November 9, 2011 at 3:42 pm
dynamic sql is about the only way i can think of to do that.
November 9, 2011 at 12:58 pm
Despite the fact that ordering by ordinal is a very bad practice you don't need to use a subquery the way Dev demonstrated. Both Paul and I showed you that...
November 9, 2011 at 12:33 pm
sanajmshaji (11/9/2011)
Please refer the below link.
Step 1
---------------------------------------------------------------------
CREATE FUNCTION dbo.fn_getByID(@ID int) RETURNS TABLE
AS
RETURN SELECT first_name FROM employee WHERE ID = @ID
GO
---------------------------------------------------------------------
Step 2
SELECT w.last_name FROM employee w
CROSS APPLY dbo.fn_getByID
(w.ID) AS...
November 9, 2011 at 11:49 am
Notice the time of both posts are a few seconds after you posted. We were all typing at the same time. Using Stuff is another way of handling what you...
November 9, 2011 at 9:35 am
It seems that the OP wants to keep the same space as 15 rows so the pdf doesnt get jumbled up. Maybe you can do a union to 15 empty...
November 9, 2011 at 9:26 am
Something like this should work for you.
SELECT stock,
Stuff((SELECT ', ' + imgname
...
November 9, 2011 at 9:11 am
Either way I guess I foolishly assumed that the OP would realize an update statement needs a where clause. If not, they will only make that mistake once. 😛 I...
November 9, 2011 at 8:21 am
Breakwaterpc (11/9/2011)
I like the non CE option better. The select statement fires off fine, but what do i need to change to make it actually update those receiptno's?
Update table...
November 9, 2011 at 7:55 am
Breakwaterpc (11/9/2011)
SELECT [Receiptno], Category
CASE [Receiptno]
WHEN category='NON' THEN REPLACE receiptno('%ENF','%NON'),
WHEN Category='DVI' THEN REPLACE Receiptno('%ENF','%DVI'),
WHEN Category='CLD' THEN REPLACE Receiptno('%ENF','%CLD')
END AS TYPE
FROM RECEIPTS
Trying to replace then end of the string "Receiptno"...
November 9, 2011 at 7:36 am
I'm with Jack on this one. Let your exception bubble back up to your .net application. In the two examples of code you provided you have different datatypes you are...
November 9, 2011 at 7:19 am
Jeff Moden (11/8/2011)
GilaMonster (11/8/2011)
The Dixie Flatline (11/8/2011)
daveriya (11/8/2011)
i want to order my result by 1,5 ..not with column nameHasn't ordering by column number been deprecated?
I thought so too, but I...
November 8, 2011 at 9:33 pm
No worries. We have all done it more times than we care to admit. Glad that you figured it out.
November 8, 2011 at 2:49 pm
You have a pretty small window of time (1 hour). Are you certain that you have records between 10am and 11am from two days ago?
November 8, 2011 at 2:17 pm
Viewing 15 posts - 13,531 through 13,545 (of 15,381 total)