Viewing 15 posts - 9,511 through 9,525 (of 10,144 total)
This should do the trick:
[font="Courier New"]DECLARE @brand_id INT
IF @brand_id IS NOT NULL
BEGIN
SELECT p.pk_product_id
FROM tbl_brands b (NOLOCK)
INNER JOIN tbl_products p ON p.fk_brand_id = b.pk_brand_id
WHERE b.fk_brand_map_id = @brand_id...
September 29, 2008 at 8:58 am
Duleep Nagahawatte (9/26/2008)
This does not give me all the data from table one! I tried this! Also i tried it with brackets! No luck!
Here's the solution kindly and expertly provided...
September 29, 2008 at 8:16 am
Philip Horan (9/25/2008)
Hi. If a user inputs 8 the the field holds the value as 480:00000.If user enters 15 then 15:00000Thanks,
Phil.
Are you absolutely sure of this, Phil?
September 29, 2008 at 7:31 am
Gareth, how about posting a real example of a statement which would cause a crash as you describe? There are numerous ways of dealing with embedded single quotes - Madhivanan...
September 29, 2008 at 7:29 am
You're welcome Sergio, thank you for your feedback.
September 29, 2008 at 7:23 am
garethmann101 (9/29/2008)
No, much better to get rid of the apostraphes from the outset I do not need them at all.
"O'Conner" becomes "O Conner", that is a much better solution...
September 29, 2008 at 7:00 am
Hi Sergio
I can't see why you are getting an error, however I can see that only one SELECT is required to fetch the data for your history table:
[font="Courier New"]USE [wce_sqlexpress]
GO
/******...
September 29, 2008 at 6:44 am
Hi Raj
Check out this article http://www.sqlservercentral.com/articles/Advanced+Querying/61716/, it describes in some detail how to do running totals. If you have difficulty with the article or with your specific problem, then repost....
September 29, 2008 at 4:49 am
Unless there's a very good reason to perform this task in two separate steps, use only one:
[font="Courier New"]SELECT TOP 20 IDENTITY(INT,1,1) AS test_id
INTO #test
FROM MASTER.dbo.syscolumns sc1,
MASTER.dbo.syscolumns sc2
SELECT * FROM...
September 29, 2008 at 3:42 am
Hi Mark
As Gail and Jeff have already suggested, change your joins to LEFT JOINS:
[font="Courier New"]SELECT h.ListingID, h.FullAddress,
c.ListingID, c.Person, c.Email, c.Phone,
e.ListingID, e.Beds, e.Baths, e.Style, e.Footage, e.[Description],
t.ListingID,...
September 29, 2008 at 3:26 am
SprocKing (9/29/2008)
September 29, 2008 at 2:23 am
Hi Bo
Thanks for providing the whole query. The next job is to identify joins which can be changed from OUTER to INNER, which will shift the run duration back towards...
September 26, 2008 at 8:10 am
Bo, we're a little short on information here - as an absolute minimum, would it be possible for you to post your query? All of it?
Cheers
ChrisM
September 24, 2008 at 10:21 am
Jerry Hung (9/24/2008)
the derived table FIRSTRUN will return ALL results, since you didn't put a WHERE condition in there
easiest way: select the actual code inside the ( .......
September 24, 2008 at 10:10 am
Viewing 15 posts - 9,511 through 9,525 (of 10,144 total)