Viewing 15 posts - 241 through 255 (of 907 total)
ok try something like this:
create table t(d datetime)
insert into t values('2002-01-01 14:15:02')
insert into t values('2002-01-01 15:15:02')
select * from t where
abs(datediff(mi,cast('1900-01-01 '+substring(convert(char(19),d,120),12,19) as datetime),
cast('1900-01-01 '+substring(convert(char(19),getdate(),120),12,19) as datetime))) <=30
Gregory Larsen, DBA
If...
June 5, 2003 at 3:08 pm
Forgot a ) probably should have been "and" instead of "or".
dateadd(mi,30,getdate()) <= field
and
dateadd(mi,-30,getdate()) >= field
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my...
June 5, 2003 at 2:32 pm
dateadd(mi,30,getdate()) <= field
or
dateadd(mi,-30,getdate() >= field
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
June 5, 2003 at 2:28 pm
You can use sp_detach/sp_attach. Read more about it in the KB article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;224071
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
June 4, 2003 at 3:31 pm
try something like:
declare @foo varchar(8000)
select @foo=cast(description as varchar(8000)) from categories where categoryid=1
print @foo
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
June 4, 2003 at 10:58 am
You might try something like this. This is how to return variables to calling program from dynamic SQL.
set nocount on
create table foobar (id int, theid int)
insert into foobar values(1,1)
insert...
June 4, 2003 at 9:42 am
You can also do this to force decimal division:
select 1000.0 / 34.0
or something like this is you want to round:
select cast(1000.0 / 34.0 as decimal(10,3))
Gregory Larsen, DBA
If you looking...
June 4, 2003 at 8:29 am
I wrote an article for SQL Server Magazine that outlined a process to do that. The process gather used and unused space stats and kept them in a database, for...
June 3, 2003 at 9:09 am
not sure this suits you needs but you might try something like this:
use pubs
Create Table Trip(
SeqNum int
,Product varchar (50)
,Van varchar(50)
,Driver varchar(50)
)
Create table ConsignmentCalls(
ForeignSeq int
,Location varchar( 50 )
)
insert into Trip
Select 123,...
June 2, 2003 at 3:31 pm
Ok next week I'm planning on sitting down and reviewing each of these mail servers recommended. Not that I want to review any more, but if there are others...
May 30, 2003 at 8:48 am
Logon to the server, bring up OUTLOOK, and check to make sure the "Save copies of Sent Message" is checked under the Properties menu when sending mail.
Gregory Larsen, DBA
If you...
May 29, 2003 at 10:58 am
Here is a way to do it without a cursor, although maybe this is not much better.
-- create tables
CREATE TABLE qualifications(ClientID int, Qualifications varchar(20))
Create table Client (ClientID int,ClientName varchar(20))
-- populate...
May 29, 2003 at 10:50 am
Or you can do just this:
Update tableA Set TableA.Value2 = TableB.Value2 from TableB where TableA.Value1 = TableB.Value1
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at...
May 29, 2003 at 10:15 am
Hummm.......Wonder if I can sell the Windows Server 2003 option?.........Don't know.......
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
May 29, 2003 at 10:08 am
I'm not sure I understand exactly what you want.
Do you want to return on one record for each distinct value of c1? Meaning either one of these...
May 29, 2003 at 7:32 am
Viewing 15 posts - 241 through 255 (of 907 total)