Viewing 15 posts - 61 through 75 (of 342 total)
If you are running on SQL2K:
--Convert Local to UTC
select DATEADD( MINUTE, DATEDIFF( MINUTE, GETDATE(), GetUTcDate()), <Local Time>)
--Convert UTC to Local
select DATEADD(MINUTE, DATEDIFF(MINUTE, GetUTCDate(), GETDATE()), <UTC Time>)
Store the value in the...
October 14, 2003 at 3:12 pm
Check out the Books Online under BEGIN TRAN or COMMIT TRAN. There is a lot of information there.
Guarddata-
October 14, 2003 at 3:00 pm
Assuming the data is well-mannered --
Could you just:
SELECT Category, AVG( CONVERT( DATETIME, <ElapseTime> ) ) AS 'Ave Elapsed'
FROM <Table>
GROUP BY Category
Guarddata-
October 14, 2003 at 8:23 am
You can use the procedure sp_rename <oldtablename>, <newtablename>
You might want to consider the original design to assure that you really want to rename - or do you want to create...
October 14, 2003 at 8:20 am
Would bcp work for you? You can use a query string with bcp to get just the information you desire.
Guarddata-
October 14, 2003 at 8:16 am
While there are some errors you can check for by accessing the @@ERROR variable, there are some that cannot be trapped. For these types of errors, you will want...
October 13, 2003 at 1:34 pm
Interesting statement... "would be fantastic if we could BCP only for one row" Care to explain further? BTW - you can bcp using a query
October 10, 2003 at 8:46 am
Not so elegant but more generic.
SELECT * FROM Table1
WHERE Col1 > 100
UNION
SELECT * FROM Table1
WHERE Col1 IS NULL AND Col2 > 100
Hint: You could use an OR...
October 10, 2003 at 8:39 am
One more then I will leave this... If the DTS error stops the process, you would probably be able to get away with a bps process. Since the...
October 7, 2003 at 2:49 pm
What was the size of the column you were attempting to add?
Guarddata-
October 7, 2003 at 10:41 am
Thanks Jonathan - I sometimes forget about the Information_Schema information ...but don't forget to GROUP BY Table_Name
Guarddata-
October 7, 2003 at 9:16 am
Two easy ways:
(1) Dynamic SQL - SET @sqlCmd = 'select *
from carrier
where CARRIER in ( ' + @a + ')'
sp_executesql @sqlCmd
(2) Temporary table
CREATE TABLE #tmpLookup (
...
October 7, 2003 at 8:25 am
SELECT SUM( SC.length )
FROM sysobjects SO (NOLOCK)
INNER JOIN syscolumns SC (NOLOCK) ON SC.id = SO.id
WHERE SO.Type = 'U' and SO.name = <Your Table Name>
Guarddata-
October 7, 2003 at 8:19 am
This one caught me for a while also... The key is to follow the subselect with AS <name>
SELECT myCol from ( select myCol from aTable) AS table
Guarddata-
October 7, 2003 at 8:14 am
One option might be to declare the table up front with your identity column. Then use INSERT INTO <table> ( < all but ident column> )
SELECT from source
Granted,...
October 3, 2003 at 10:51 am
Viewing 15 posts - 61 through 75 (of 342 total)