Viewing 15 posts - 14,761 through 14,775 (of 15,381 total)
I see a couple of big hurdles for what you are trying to do. First an audit or history is about a million times easier if you record the whole...
May 2, 2011 at 11:04 am
So given your example what do you want the output to be? Read the link in my signature for details about how to ask a question that is more likely...
May 2, 2011 at 10:54 am
The other problem is that you are using float as your datatype which is an approximate datatype and your value on record 4 is very large. Try changing the column...
May 2, 2011 at 10:34 am
You don't have any numbers to the right of the decimal so your number is being truncated.
Decimal (38,0)
You will need to change this datatype in order to get decimal place...
May 2, 2011 at 10:21 am
Glad that helped. That block of code is called a comm table expression, frequently referred to as a cte. To steal the line from Wayne's signature...
If you can't explain to...
April 29, 2011 at 2:16 pm
The following code would get the entire hierarchy but I am not sure this is what you want.
declare @EmpID char(10)
set @EmpID = 'Rs001'
;with cte as (
select EmpID, ManagerId from...
April 29, 2011 at 1:01 pm
This is certainly a good start. Now what do you want the output to be?
April 29, 2011 at 12:43 pm
How about some ddl and some readily consumable data? For instruction view the link in my signature.
April 29, 2011 at 9:39 am
With no ddl or sample data it is a stab in the dark but I guessing that your problem is in
where OUR.IsActive IN (SELECT DISTINCT ITEMS FROM dbo.Split(@ActiveStatus, ','))
My...
April 29, 2011 at 7:59 am
LOL nvm. If I actually read what you posted I would had a different answer. 😛
April 28, 2011 at 2:44 pm
How about
select
floor(rowid),
sum(case when [status] like '%in-service%' then 1. else 0. end)
...
April 28, 2011 at 2:42 pm
Jason Selburg (4/28/2011)
select
rowid,
sum(case when [status] like '%in-service%' then 1 else 0 end)
--/ (count(*)*1.) as Availability -- the *1. is to force...
April 28, 2011 at 2:24 pm
See if this gets you closer
Declare @hostNameIP VARCHAR(1000);
set @hostNameIP = 'AMEDNBWR01C003X';
Declare @softwares VARCHAR(Max);
set @softwares = NULL;
Declare @Make VARCHAR(5000);
Set @Make = 'LENOVO';
Declare @SoftwareQuery VARCHAR(5000);
CREATE TABLE #SoftwareInfo
(
HostName Varchar(1000),
SerialNum Varchar(100),
SWName Varchar(1000),
Version Varchar(1000)
)
INSERT INTO...
April 28, 2011 at 2:19 pm
I still say drop the dynamic sql. From the code you have posted there is absolutely no need to build a big old nasty string and execute it. Just perform...
April 28, 2011 at 2:09 pm
Viewing 15 posts - 14,761 through 14,775 (of 15,381 total)