Viewing 15 posts - 511 through 525 (of 600 total)
blandry (9/20/2010)
Even gaming software requires storage, retrieval and use of data!
But alas... Each time we post ads for new developers, inevitably...
September 21, 2010 at 6:49 am
Speaking of a prettier way, you can just add sex to the temp table:
DECLARE @mydata TABLE
(
PersonID INT,
Age INT,
NationalityID INT,
Sex char(1)
)
INSERT INTO @mydata (PersonID,Age,NationalityID,Sex)
SELECT 100,5 ,9000,'M' UNION ALL
SELECT 101,13,1000,'M' UNION ALL
SELECT...
September 20, 2010 at 9:14 pm
Your problem is that you need a male and female for every range, which basically means even with an outer join to your CTE you cant create the M and...
September 20, 2010 at 8:30 pm
As someone who first programmed for one small IT group, and now manages a different one, that this is a very important skill.
There are certainly larger employers out there with...
September 20, 2010 at 12:45 pm
It would really help to have DDL so we could test.
Could you also clarify your requirement? Can the view have multiple records for a given case number?
For example, if...
September 17, 2010 at 9:23 am
Here is a solution with a self join. It could probably be tewaked for better performance and I wouldnt be surprised if there's a better way, but it gets...
September 16, 2010 at 9:00 pm
A signature is a setting on someone's forum membership that inserts text at the bottom of all their posts.
He was linking you to this article: http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]
September 16, 2010 at 8:30 pm
What should the output look like? Can you provide a sample table/data and then a sample of what the output would look like?
Also, just so that I'm clear, you have...
September 16, 2010 at 2:38 pm
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE #pagelist(
[userID] [int] NULL,
[pageName] [nvarchar](255) NULL,
...
September 15, 2010 at 10:09 am
Magy (9/15/2010)
I tried using 101 instead of 103, and I still get a random order by.
I also just tried doing ORDER BY pageDate, but that...
September 15, 2010 at 9:29 am
WayneS (9/3/2010)
LutzM (9/3/2010)
WayneS (9/2/2010)
Based on this, where the work order ID is the 2nd "field" in this string, I would suggest :
declare @test-2 varchar(100);
set @test-2 =...
September 3, 2010 at 12:59 pm
Here's a fix to Michael's:
declare @emp table
(empid int identity(1,1) primary key clustered, dob datetime not null)
insert into @emp (dob)
SELECT convert(datetime,'1962-01-01 00:00:00.000') AS dob UNION ALL
SELECT convert(datetime,'1958-12-31 00:00:00.000') AS dob UNION...
September 3, 2010 at 10:33 am
Michael, your code fails when one year rolls over to another
for example, with the test cases and the presumed current date modified:
declare @emp table
(empid int identity(1,1) primary key clustered, dob...
September 3, 2010 at 10:16 am
Saravanan_tvr (9/3/2010)
Hi In veiw the sq server wont allow to use the declarations,
Ok, so you've got a function that gives you a delimited list of columns.
And you want a view...
September 3, 2010 at 10:00 am
bpowers (9/2/2010)
Any idea how I could trim this out to only return the W51247?W~W51247~0~1~0
Can you give us some clearer requirements?
I mean, substring(@fieldname,3,6) would work for that example, but maybe not...
September 2, 2010 at 2:35 pm
Viewing 15 posts - 511 through 525 (of 600 total)