Viewing 15 posts - 1 through 15 (of 30 total)
Hello again,
I managed to find a simple solution that seems working on sample tables.
;WITH Final_TB AS
(
SELECT X.SAMPLE_ID, X.AntiBio, #TestTb1.P1, #TestTb1.P2, #TestTb1.P3, #TestTb1.P4 FROM
(
SELECT [Sample_ID],'AB1' AS [AntiBio]
FROM #TestTb2 WHERE...
May 4, 2013 at 7:58 am
Dear Grant,
Thanks for your help. I will check the login profiles and their privileges.
Regards
April 1, 2013 at 9:03 am
AndrewSQLDBA (3/31/2013)
Why would you be developing against a production database? If needed, create a database on...
April 1, 2013 at 8:59 am
Lynn Pettis (3/28/2013)
IF object_id('tempdb..#testEnvironment') IS NOT NULL
BEGIN
DROP TABLE #testEnvironment;
END;
CREATE TABLE #testEnvironment ([Sample_ID] INT, [Rep_ID] INT, [Result] VARCHAR(20))
INSERT INTO #testEnvironment
SELECT 1, 1,...
March 28, 2013 at 8:49 am
Cadavre (2/28/2013)
With this sample data: -
IF object_id('tempdb..#testEnvironment') IS NOT NULL
BEGIN
DROP TABLE #testEnvironment;
END;
SELECT [Sample_ID], [Rep_ID], [Result]
INTO #testEnvironment
FROM (VALUES(1, 1, 'O152'),(1, 2, 'O2'),(1,...
March 27, 2013 at 7:23 pm
ryan.mcatee (3/23/2013)
SELECT Antibiotic, SUM(CASE WHEN Result IN (1, 2) THEN 1 ELSE 0 END) AS Tests
, SUM(CASE WHEN Result =...
March 23, 2013 at 7:37 am
Steven Willis (3/7/2013)
March 7, 2013 at 8:38 pm
Deque (3/7/2013)
Does this do what you are looking for?
SELECT C_NAME, ROW_NUMBER() OVER(PARTITION BY C_NAME ORDER BY C_NAME ASC) AS ITEM_NO, REQ_ITEM FROM @test1
Yep, It worked.
Thanks Deque
March 7, 2013 at 10:57 am
RZ52 (3/7/2013)
Jason-299789 (3/7/2013)
INSERT INTO @test1(C_NAME, C_CODE)
(SELECT P_NAME,
C_CODE = 'CL' +...
March 7, 2013 at 9:21 am
Jason-299789 (3/7/2013)
INSERT INTO @test1(C_NAME, C_CODE)
(SELECT P_NAME,
C_CODE = 'CL' + CONVERT(VARCHAR(5),@x+ROW_NUMBER()...
March 7, 2013 at 8:31 am
Lynn Pettis (3/2/2013)
You may want to read the following articles:
Dear Lynn,
Thanks for guidance. I read them and the articles gave me some idea. However, my main issue is how to...
March 2, 2013 at 8:38 am
Jeff Moden (3/1/2013)
No answer in 14 hours. Take a look at the article at the first link in my signature below for a way to change that.
Hi again,
Following kind...
March 1, 2013 at 10:51 pm
Dear Jeff,
Thank for the link and guidance. I opened this topic about 2 hours ago. As here is midnight, I will come back tomorrow and modify my topic.
Thanks again
March 1, 2013 at 10:29 pm
Sean Lange (3/1/2013)
select *
March 1, 2013 at 4:03 pm
Erin Ramsay (3/1/2013)
select letter from @test1 order by (case letter when 'd' then 1 when 'c' then 2 when 'b'...
March 1, 2013 at 3:13 pm
Viewing 15 posts - 1 through 15 (of 30 total)