Viewing 15 posts - 2,566 through 2,580 (of 3,544 total)
SET DATEFIRST 7 --Set First Day of Week to Sunday
SELECT SUM(CASE WHEN DATEPART(weekday,[date]) = 1 THEN [column] ELSE 0 END) AS 'Sun',
SUM(CASE WHEN DATEPART(weekday,[date]) = 2 THEN [column] ELSE...
Far away is close at hand in the images of elsewhere.
Anon.
July 20, 2004 at 8:12 am
To be honest, I don't know. I think it is just a name that was chosen, maybe I should have typed it as Maud. Just seemed appropriate, no offence to...
Far away is close at hand in the images of elsewhere.
Anon.
July 14, 2004 at 2:20 pm
A lot of interesting comments.
I have no problem with asking this type of question as it will give you insight into the approach to problem solving. That is, do they...
Far away is close at hand in the images of elsewhere.
Anon.
July 13, 2004 at 10:52 am
create proc spListEmployees (@Active smallint = 0)
as
Declare @NoOfEmployee integer
select @NoOfEmployee = count(*)
from employee
where charindex(status,substring('IA',@Active+1,2)) > 0
print 'NoOfEmployee=' + Cast (@NoOfEmployee as varchar(10))
GO
Far away is close at hand in the images of elsewhere.
Anon.
July 8, 2004 at 7:12 am
nice on kailash, good solution.
FINDSTR is a DOS command for finding text in a file.
If you goto 'Command Prompt' (Satrt/Programs/Accessories) and type in
FINDSTR /?
you will see all the parameters available.
Far away is close at hand in the images of elsewhere.
Anon.
July 7, 2004 at 7:40 am
Yes but why. Use FINDSTR.
But if you do want to use DTS then
Create two tables using Execute SQL Task
Transform the text file (Source) to first table
Insert into second table rows required using...
Far away is close at hand in the images of elsewhere.
Anon.
July 7, 2004 at 7:14 am
If cnt will not exceed 255 then
select c.acctNo
from tblCalcs c
inner join master.dbo.spt_values n
on n.type = 'P' and n.number between 1 and c.cnt
where c.cnt > 0
otherwise...
Far away is close at hand in the images of elsewhere.
Anon.
July 7, 2004 at 6:39 am
Openrowset should work, like this
UPDATE t2
SET t2.Status = t1.Status
FROM Table2 t2
INNER JOIN OPENROWSET('MSDASQL',
'Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\mydb.mdb;Uid=admin;Pwd=',
'select * from Table1') t1
ON t1.ID =...
Far away is close at hand in the images of elsewhere.
Anon.
July 6, 2004 at 6:46 am
If all columns the same datatype, ugly, poor performance but maybe ...
SELECT MAX(maxval) as [maxval]
FROM (
SELECT MAX(col3) as [maxval] FROM
UNION
SELECT MAX(col4) as [maxval] FROM
UNION...
Far away is close at hand in the images of elsewhere.
Anon.
July 5, 2004 at 6:27 am
Use a temp table and identity column
create table #temp1 (rowid int, col1 char(1))
insert into #temp1 values (1,'A')
insert into #temp1 values (2,'B')
insert into #temp1 values (3,'C')
create table...
Far away is close at hand in the images of elsewhere.
Anon.
June 28, 2004 at 7:25 am
You caould use another temp table and a loop (see below) but probably not what you want if you do not want to use a cursor. Otherwise your only hope...
Far away is close at hand in the images of elsewhere.
Anon.
June 28, 2004 at 7:17 am
How about this
ALTER PROCEDURE PS_Migration_DBMED_PABI_2 @DbnameSource _label, @DbNameDestination _label
AS
SET NOCOUNT ON
Declare @sql nvarchar(1200)
BEGIN TRAN
SET @sql = 'INSERT INTO ' + @DbNameDestination + '..PABI
(PA_ID)
SELECT
(
SELECT MIN(pa_id)
FROM ' + @DbNameDestination.dbo.PA +...
Far away is close at hand in the images of elsewhere.
Anon.
June 25, 2004 at 7:31 am
Hopefully
the table has an ID column.
DECLARE @reviewid int, @ptr binary(16), @idx int
SET @reviewid = 0
SELECT TOP 1 @reviewid = reviewid,...
Far away is close at hand in the images of elsewhere.
Anon.
June 24, 2004 at 6:50 am
SELECT d.Account, d.ManTyp,
ISNULL(a.Document,'') AS [Document1],
ISNULL(b.Document,'') AS [Document2],
COALESCE(b.Portvalue,a.Portvalue) AS [Portvalue]
FROM (
SELECT DISTINCT Account, ManTyp
FROM
) d
LEFT OUTER JOIN a
ON...
Far away is close at hand in the images of elsewhere.
Anon.
June 23, 2004 at 6:44 am
| Showing your age? |
Ouch! ![]()
Far away is close at hand in the images of elsewhere.
Anon.
June 23, 2004 at 5:28 am
Viewing 15 posts - 2,566 through 2,580 (of 3,544 total)