Viewing 15 posts - 106 through 120 (of 239 total)
Try something like this:
--turn a wide table into a narrow table
declare @Table table (col1 int, col2 int, col3 int)
insert @Table values (1, 2, 4)
select 'col1' as colname, col1 as colvalue
from...
March 8, 2006 at 9:36 am
Try this:
declare @Table table (col1 int, col2 int, col3 int)
insert @Table values (1, 2, 4)
select 'col1' as colname, col1 as colvalue
from @Table
union all
select 'col2' as colname, col2
from @Table
union...
March 8, 2006 at 8:25 am
I don't know of a maximum but it may be related to the fact that columns_update() returns a bitmask and that 2^104 is quite a large number.
I would consider changing...
March 7, 2006 at 4:04 pm
Try this:
UPDATE b
SET fiscal_month_name = p.month_name
FROM tbl b
INNER JOIN period p
ON B.dt BETWEEN p.from and p.to and B.FISCAL_DAY = 15
March 7, 2006 at 3:15 pm
Since you are using a front end, why not just return the list to the client and concatenate them in the ASP page?
March 7, 2006 at 9:01 am
Try this:
declare @UserAddr table (user_fk int, addr_fk int)
insert @UserAddr values(780579, 102261)
insert @UserAddr values(780579, 102263)
--return just the user_fk
select user_fk
from @UserAddr
group by user_fk
having count(*)>1
--return just the user_fk and addr_fk
select ua.*
from @UserAddr...
March 7, 2006 at 8:56 am
The statement 'SELECT DataTable = @DataTableID' is not valid syntax.
March 7, 2006 at 8:50 am
Try this:
OSQL /U SA /P password -S localhost -d master /i MYQUERY.SQL /o MYRESULTS.TXT -n -h-1
Note that you should use OSQL instead of ISQL and there is no need to...
March 7, 2006 at 8:23 am
What about 5/4, 5/5 & 5/6 and 5/5, 5/6 and 5/7
This may work if they are to be included:
declare @Table table (dt datetime, nbr int)
insert @Table values ('1/1/05', 0)
insert @Table...
March 7, 2006 at 8:07 am
I agree with Ryan, why not just do an UPDATE on the table?
March 6, 2006 at 12:24 pm
Note that in my query, there is no subquery. This should help the performance.
March 6, 2006 at 8:30 am
Try this and add the remaining months:
declare @Table table (ID int, Jan int, Feb int, March int, April int)
insert @Table values (1, 2, 4, 6, 8)
insert @Table values (2, 3,...
March 3, 2006 at 5:38 pm
Try this without using views:
declare @table table
(ID_VAL INT identity(1,1),
Date_Field Datetime
)
insert into @table values ('02/12/2006')
insert into @table values ('02/13/2006')
insert into @table values ('02/14/2006')
insert into @table values ('02/15/2006')
insert into @table values ('02/17/2006')
insert...
March 3, 2006 at 5:09 pm
This works, with some changes to the query and criteria to test it:
declare @charts table (patientno int, lastname varchar(20), firstname varchar(20), sex char(1), race char(2), loc char(3), docid int,...
March 3, 2006 at 4:29 pm
You can try something like this:
declare @Employee Table (EmpName varchar(10), EmpDesignation char(3))
insert @Employee values ('Muthu K', 'ITA')
insert @Employee values ('Muthu K', 'ITA')
insert @Employee values ('Muthu K', 'ITA')
insert @Employee values ('Muthu...
March 3, 2006 at 1:56 pm
Viewing 15 posts - 106 through 120 (of 239 total)