Viewing 15 posts - 31 through 45 (of 178 total)
Then you need a dynamic sql:
use tempdb
CREATE TABLE #Temp
(
PropRef INT,
AttributeName VARCHAR(50),
AttributeValue VARCHAR(50)
)
INSERT INTO #Temp (Propref, AttributeName, AttributeValue)
SELECT...
October 18, 2009 at 5:02 am
Is the problem that there are so many values for AttributeName, or you don't know up front which AttributeNames need to be in the result?
October 18, 2009 at 4:46 am
Hi Matt,
sorry, I'm not clear on what you need here. Are you having trouble with the query for creating the intermediate table or getting that table into Crystal Report?
If...
October 18, 2009 at 4:31 am
Hi Mat,
yeah, a little clearer.
DECLARE @Temp TABLE
(
PropRef INT,
AttributeName VARCHAR(50),
AttributeValue VARCHAR(50)
)
INSERT INTO @Temp (Propref, AttributeName, AttributeValue)
SELECT 100058, 'Heating...
October 18, 2009 at 3:44 am
Dupe post, please see http://www.sqlservercentral.com/Forums/Topic804758-1291-1.aspx
October 18, 2009 at 2:27 am
Any chance you could post some table definitions and sample data please?
It'll be a lot easier to try and help!
See following article how to do that http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 18, 2009 at 2:24 am
Hi Jeff,
many thanks for taking the time to research, write and post this eagerly anticipated article!
Just tried running some of the code and have noticed missing whitespace from figures 2,...
October 17, 2009 at 8:59 am
Hi,
had a closer look at this, basically I see two main solutions, compute the shift name with a case statement, which is fine when the shift patterns never change, or...
October 17, 2009 at 7:52 am
do you mean?
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'EMAIL REMOVED',
@subject = 'Something Important',
@query = 'select * from TableName where Source = 1 and (name like '%I%' or name like '%O%')',
@attach_query_result_as_file = 1,
@profile_name =...
October 16, 2009 at 1:16 pm
You didn't provide any test data, here's some courtesy of Jeff:
--===== Create and populate a 1,000,000 row test table.
-- Column "RowNum" has a range of...
October 16, 2009 at 12:54 pm
October 12, 2009 at 5:58 am
Do you have duplicate values of delegate_name?
August 13, 2009 at 4:33 am
You may consider flattering your MD's business acumen by suggesting that when he leads the company from strength to strength — entering new markets, acquiring competitors, diversifying your product...
August 13, 2009 at 2:36 am
Sorry Lynn, had that posted before I saw your's.
Absolutely agreed, DDLs etc. would be very helpful!
August 12, 2009 at 6:30 am
USE TEMPDB
DECLARE @temp TABLE (Country VARCHAR(20), Sales INT)
INSERT INTO @temp
SELECT 'Sweden', 7777 UNION ALL
SELECT 'Denmark', 10000 UNION ALL
SELECT 'Russia', 9999 UNION ALL
SELECT 'Country1', 1 UNION ALL
SELECT 'Country2', 1 UNION ALL
SELECT...
August 12, 2009 at 6:29 am
Viewing 15 posts - 31 through 45 (of 178 total)