Viewing 15 posts - 2,356 through 2,370 (of 3,543 total)
If you want to do this in T-SQL then you could do it this way
CREATE TABLE test (F1 varchar(100))
BULK INSERT test FROM 'c:\temp\test.csv' WITH ( ROWTERMINATOR = '\r\n' )
DECLARE @updct...
March 4, 2005 at 7:53 am
Good question, not sure about the correct answer though.
I thought I would test this. First what is a temporary object in a procedure, a temp table seemed like the obvious...
March 4, 2005 at 2:31 am
Bulk Insert (BCP) will not honour quotes and will treat them like normal data.
Your best bet is to use DTS which will enable you to utilize the quotes correctly.
March 3, 2005 at 7:34 am
I agree with Jonathan, use activex in DTS like this
Function Main()
strName = DTSSource("Whole_Name")
strName = Replace(strName, ",", " ", 1, -1)
strName = Replace(strName, ".", "...
February 25, 2005 at 8:08 am
If the duration between the two dates is within an hour then
DECLARE @date1 datetime, @date2 datetime
SET @date1 = '20050224 13:12:04'
SET @date2 = '20050224 13:47:52'
SELECT RIGHT(CONVERT(varchar,DATEADD(second,DATEDIFF(second,@date1,@date2),0),108),5)
Otherwise you...
February 24, 2005 at 6:49 am
![]() | Hey, if anyone knows of system function that does this |
You should be able to achieve the same...
February 10, 2005 at 7:09 am
What is the actual value of <zero-length value>
If it contains 026 0x1A, then it represents ascii eof and the file will seem truncated to certain applications.
February 9, 2005 at 7:12 am
use the -q (quoted identifier) parameter to BCP
February 9, 2005 at 6:52 am
Replace the code with this
DECLARE @sql nvarchar(4000)
SET @sql = 'INSERT INTO ' + @Tablename + '('
COL_NAME(OBJECT_ID(@Tablename), ORDINAL_POSITION) +
CASE WHEN ORDINAL_POSITION < (select count(*)...
February 7, 2005 at 4:21 am
![]() | , after Every statement |
This would indicate that you have more data columns than columns in the table
February 7, 2005 at 2:20 am
Well I wouldn't say mine is right or better, I always believed it was spelt colic but ...
There is a word colicky (adjective)
1 : relating...
February 4, 2005 at 11:11 am
OK try this
Create a udf
CREATE FUNCTION dbo.udf_get_string
(@str varchar(1000), @num int, @delim char(1))
RETURNS varchar(100)
AS
BEGIN
DECLARE @start int,@end int
SET @end = 0
WHILE (@num > 0)...
February 4, 2005 at 7:28 am
OK, data type mismatch is as it states, there must be a problem with the data or column matching.
To convert char date to datetime, use CAST(chardate as datetime). However if...
February 4, 2005 at 4:02 am
![]() | Who's next....? |
Not me!