Viewing 15 posts - 8,026 through 8,040 (of 8,731 total)
It's quite easy to accomplish this task. The slowest part is to recreate the DDL and sample data. This time I did it on a CTE, but you should take...
June 19, 2013 at 1:10 pm
Sean Lange (6/19/2013)
What is the purpose of this? This is going to require some pretty complicated dynamic sql for this.
It's not that complicated, but it seems like a very bad...
June 19, 2013 at 1:01 pm
Take a look at this articles and return if you still have questions 😉
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/url]
June 19, 2013 at 8:46 am
Here's one idea, but I have no idea if it will fit your needs or if it will perform fine
WITH option1 AS(
SELECT 1 AS column1,
...
June 18, 2013 at 5:32 pm
For more information, I recommend you to read the following articles that would even allow you to return a variable number of columns.
June 18, 2013 at 3:52 pm
Arul prakash (6/18/2013)
SELECT *FROM @Client cl
JOIN @ValidDates vd
ON 2=2
where cl.ValidDate BETWEEN vd.StartDate AND vd.EndDate
Anything we give same value for on condition......
You missed the point, the OP didn't want...
June 18, 2013 at 8:57 am
Let me give you an example by simplifying your code.
DECLARE @id INT
SELECT @id= max(id) + 1
FROM TABLE
INSERT INTO TABLE (
id
,country
)
SELECT
n
,'Germany'
FROM dbo.Tally
WHERE n BETWEEN @id AND @id <= 1002261
You wouldn't...
June 14, 2013 at 2:43 pm
So, you basically want to generate IDs with the same value X number of times?
For that, you can check The "Numbers" or "Tally" Table: What it is and how it...
June 14, 2013 at 1:55 pm
Something like this?
http://www.sqlservercentral.com/articles/Data+Generation/87901/
June 14, 2013 at 1:28 pm
Now I am concerned. Do you really need to delete Patient information?
If it's just to show the names, then this might help.
WITH Unique_PT AS(
SELECTPT_LST_NAM + CASE WHEN ALS_FLG = 'Y'...
June 14, 2013 at 12:51 pm
Something like this? or am I missing something?
SELECT *
FROM OneTable a
FULL
JOIN OtherTable b ON substring(a.ANUM,4,10) = substring(b.ANUM,4,10)
...
June 14, 2013 at 11:36 am
Without sample data to test, I might be giving you the wrong solution but with the previous mentioned articles you should be able to fix it or ask specific questions.
SELECT...
June 14, 2013 at 10:52 am
You should take a look at these articles
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns[/url]
June 14, 2013 at 10:46 am
The condition is to get the rows that don't exist on either table using the FULL JOIN. I took a shot at guessing ANUM wouldn't be nullable or at least...
June 14, 2013 at 10:30 am
I can't understand the problem. You say there are no rows where IsResSchedule = 1 , but the code for the new sample data shows 2 rows with IsResSchedule =...
June 14, 2013 at 10:22 am
Viewing 15 posts - 8,026 through 8,040 (of 8,731 total)