Viewing 15 posts - 2,491 through 2,505 (of 3,543 total)
I have posted in your other thread re OPENROWSET. Are these two related?
October 25, 2004 at 9:05 am
Join the two queries together, you can reference the result of the OPENROWSET as a table
SELECT J.Job_ID, J.J_Open_Date, J.J_Priority, J.J_Vendor_ID, P.VendName
FROM Job_Tracking_Table J
INNER JOIN OPENROWSET('SQLOLEDB','AMKSQL2';'abc';'cde', 'SELECT VendorID, VendName...
October 25, 2004 at 9:03 am
DECLARE @hours TABLE (Tagname varchar(256), H int)
insert into @hours
select c.Tagname,v.number
from (
select a.Tagname,datepart(hour,a.[Datetime]) as [H], min(datepart(hour,b.[Datetime])) as [H2]
from @History a
inner join @History...
October 25, 2004 at 4:46 am
Another way
select var1,var2
from table1
where charindex( ',' + var3 + ',' , ',' + @local + ',' ) > 0
October 25, 2004 at 2:20 am
![]() | please expalint the (convert(char(8),getdate(),120) + '01' ) |
Convert allows you to convert dates to specific formats, eg style 120...
October 25, 2004 at 2:12 am
select * from where datepart(m,datecolumn) = datepart(m,getdate()) - 1
will select previous month on any day of the month
but will result in either a table scan (or index scan...
October 22, 2004 at 10:38 am
Similar to Kenneth's
SELECT a.GroupID, a.GroupName, b.NoID, c.ContactNo, Datetime, Detination
FROM [TableA] a
INNER JOIN [TableB] b
ON b.GroupID = a.GroupID
INNER JOIN [TableC] c
ON c.ContactNo = b.ContactNo
WHERE a.GroupID...
October 22, 2004 at 10:08 am
They will both use 9 bytes as you stated but
(17,3) will only allow a maximum of 14 digits to the left of the decimal point
(19,3) will allow 16
October 22, 2004 at 9:50 am
The only way I have achieved this is to use temp tables and a loop
In what format do you want the output?
October 22, 2004 at 7:05 am
SUBSTRING is limited to the maximum string length in sql (8000 less any overhead)
why not just update one table directly from the other like this
UPDATE p
SET p.[Description] = d.[Description]...
October 21, 2004 at 11:11 am
GROUP BY
divides the data into groups and produces a list of unique values (like DISTINCT) and allows counting, summation etc
so
select col1 from test group by col1
will produce the same as
select...
October 21, 2004 at 10:40 am
The data will need an identity column to specify the order of concatenation (or does this not matter?)
If the table has an identity column (eg rowid) then try
create table [mytable]...
October 21, 2004 at 7:45 am
If I understand correctly and if both tables have the same number and type of columns then this
SELECT ID1, ID2, col1, col2, colx
FROM [table1]
UNION
SELECT ID1, ID2, col1,...
October 21, 2004 at 7:17 am
In addtion, two things
When you transfer logins they will not necessarily retain their default database.
If you transfer sql logins be careful of passwords. If the destination server has a different...
October 19, 2004 at 7:08 am
Viewing 15 posts - 2,491 through 2,505 (of 3,543 total)