Viewing 15 posts - 3,256 through 3,270 (of 3,544 total)
In .NET is use
Now().ToString("s").Replace("T", " ")
which gives me yyyy-mm-dd hh:mm:ss format, which sql has no problems.
If you do not want the time portion use
Now().ToString("s").Substring(0,10)
Far away is close at hand in the images of elsewhere.
Anon.
June 11, 2003 at 6:49 am
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...
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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.
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
June 10, 2003 at 7:42 am
Interesting!
Hope there aren't any unscrupulous DBA's with a company grudge reading this.
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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) >...
Far away is close at hand in the images of elsewhere.
Anon.
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)...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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)
Far away is close at hand in the images of elsewhere.
Anon.
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,
...
)
Far away is close at hand in the images of elsewhere.
Anon.
May 30, 2003 at 11:09 am
Viewing 15 posts - 3,256 through 3,270 (of 3,544 total)