Viewing 15 posts - 7,291 through 7,305 (of 8,731 total)
You don't need to go through each store with a while loop. You can remove all duplicates at a time. There are several ways to do this and the best...
December 30, 2013 at 2:31 pm
There's no need to do a previous conversion to datetime if this is a one time extraction as SQL Server will do an implicit conversion.
WITH SampleData AS(
SELECT CAST( '2013-12-30 12:09:00.123'...
December 30, 2013 at 1:18 pm
You're welcome.
Do you understand why did it work? You need to understand it to make any further modifications.
December 30, 2013 at 12:29 pm
OCTom (12/29/2013)
December 30, 2013 at 9:18 am
The easiest way would be to do as you say, I'm not sure if there's some way around.
CREATE PROCEDURE CallingProcedure
(
@StartDate date,
@EndDate date,
...
December 27, 2013 at 12:48 pm
Here's a code to show you how can it be done. You might need to fix it.
DECLARE @dbname sysname
CREATE TABLE #counts( totalcounts int)
DECLARE DBs CURSOR FOR
SELECT name
FROM sys.databases
WHERE database_id >...
December 27, 2013 at 10:30 am
happy55 (12/27/2013)
Yes I had a where clause for table B.I removed it as per your suggestions and it works:-)Thanks for your help
I've seen it a lot of times and it...
December 27, 2013 at 10:02 am
If you have problems with pivot, you should try the method I posted earlier. It's even better when you need to pivot several columns. You'll find information in the link...
December 27, 2013 at 9:56 am
Do you have a WHERE clause in your query using a column from table B?
That might be the issue. If you do, change it to the JOIN clause.
December 27, 2013 at 9:44 am
You didn't need to open a new thread. You could just post this on the previous one.
Here's an example, but don't blame me if it doesn't work as you want...
December 27, 2013 at 9:35 am
I'm helping here for free.
If you want simple examples, you can press F1 and find examples on PIVOT. Or you can click on the "useless" link I provided to...
December 27, 2013 at 9:04 am
You could read this article to find out how to work with CROSS TABS.
http://www.sqlservercentral.com/articles/T-SQL/63681/
For a coded answer, please read the article linked in my signature to now what we need...
December 27, 2013 at 8:54 am
You're welcome.
But, do you understand how it works?
December 27, 2013 at 8:16 am
What you're trying to do is explained on this article. http://www.sqlservercentral.com/articles/comma+separated+list/71700/
Read it and check the solution.
SELECT customer_id,
all_emails = STUFF((SELECT ' -- ' + email_text
FROM emails x
WHERE x.customer_id = e.customer_id
FOR XML...
December 27, 2013 at 8:05 am
vladisaev@hotmail.com (12/26/2013)
you can try to get a 'blind' performance gain by using @Table table type variable instead of
#temporary table. You can gain performance improvement...
December 26, 2013 at 2:21 pm
Viewing 15 posts - 7,291 through 7,305 (of 8,731 total)