Viewing 15 posts - 3,256 through 3,270 (of 3,543 total)
If all the dates are consecutive then join the table to itself with date-1.
If the dates are not consecutive then join the table to itself with max(date) < date
If the...
June 11, 2003 at 6:28 am
DECLARE @SomeVariable varchar(10)
SET @SomeVariable = '1,2,5'
SELECT * FROM TableA WHERE CHARINDEX(CAST(ColumnB as varchar),','+@SomeVariable+',') > 0
June 11, 2003 at 6:16 am
Agree, no simple way.
If the table names have something unique and common, eg all start with fred (fred1,fred2 etc) the you could use sp_MSforeachtable to repeat the update on each...
June 11, 2003 at 6:07 am
rflewitt,
The problem with your statement is that sql still has to convert the date to do the isdate check and would fail.
June 11, 2003 at 2:26 am
If your 100 tables have similar names, e.g. all start with peter (peter1,peter2 etc). Then you could use this
sp_MSforeachtable @command1="update ? set doc = replace(replace('?','[dbo].[',''),']','')+' '+doc",@whereand = "and name like...
June 10, 2003 at 8:05 am
I have the same problem with DTS from a 3rd party db using their odbc driver. My dates are typically 0203-06-10 format (typo!!).
What I do is to change the transformation...
June 10, 2003 at 7:42 am
Interesting!
Hope there aren't any unscrupulous DBA's with a company grudge reading this.
June 10, 2003 at 7:21 am
If you still want the batch file method, this might do it.
@echo off
cls
echo Installing 1 of n
osql /Sserver /Uuser /Ppassword -ddatabase -b /m-1 -iInstall01.sql -oInstall01.Err
IF...
June 10, 2003 at 6:48 am
If have understood your logic correctly the this should do the trick
select x.*
from atable x
left outer join atable a on a.Computer_Name = x.Computer_Name and a.Operating_System...
June 9, 2003 at 8:45 am
Use this to either update table in situ or create temp table from original and run query against temp table
declare @ct int
select @ct = count(*) from tablea where charindex(char(13),textcol) >...
June 5, 2003 at 11:19 am
Hi Frank,
Not to labour this point but I did read some articles on web regarding clustering which stated that each server had a C:\ drive where the software (ie SQL)...
June 5, 2003 at 8:53 am
I have no experience or knowledge of clustered servers so I found the question impossible to answer. Took a guess and got it wrong
I looked on...
June 5, 2003 at 6:07 am
declare @IDorder int,@Order_num int
set @IDorder=1
select @Order_num = isnull(max(Order_num),0)+1 from order_line where IDorder = @IDorder
insert into Order_Line (IDorder,Order_num)
values (@IDorderm,@Order_num)
June 2, 2003 at 3:09 am
Just the same way as you would if they parameter variables, e.g.
INSERT INTO AccidentMain(
EmpID,
DeptID,
...
FName,
LName,
Address,
City,
State,
ZipCode,
...
)
VALUES (
@EmpID,
@DeptID,
...
@FName,
@LName,
@Address,
@City,
@State,
@ZipCode,
...
)
May 30, 2003 at 11:09 am
Two ways
1. Declare the employee columns as input params to proc, in asp before calling InsertAccidentRep call another proc to retrieve them from employee table and then pass them to...
May 30, 2003 at 9:34 am
Viewing 15 posts - 3,256 through 3,270 (of 3,543 total)