Showing posts with label separator. Show all posts
Showing posts with label separator. Show all posts

Wednesday, March 21, 2012

How come this dont work?

What is the definition of the table. Also, you didn't specify a row separato
r. Perhaps the table has
only one columns and you really want ~ as the row terminator?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Deasun" <Deasun@.discussions.microsoft.com> wrote in message
news:BCA35F53-B895-4F6A-9435-8AA493BA3338@.microsoft.com...
> Ok I am new to this command, BULK INSERT, I cant seem to get this to work
or
> error out for me.
> Heres what I have;
> BULK INSERT TBL_Master_DoNotCallList_Loader
> FROM 'E:\DE_210652006.txt'
> WITH
> (
> FIELDTERMINATOR = '~'
> )
> I am running this thru QA logged in as the Admin.
> The file is in the location and the date looks like so, in Notepad.
> 302,2066707~302,2074122~302,2076346~302,
2077647~302,2094465~
> ~ is the field and row terminator.
> When I run above cmd I get it telling me it ran successfully.
> But theres no data in table and it runs instantly.
> Any help would be appreciated.
> Thanks
> Deasun
> --
> Deasun
> Home Site: www.tirnaog.com
> Check out: The Code Vault in my forums section."Deasun" wrote:

> Heres what I have;
> BULK INSERT TBL_Master_DoNotCallList_Loader
> FROM 'E:\DE_210652006.txt'
> WITH
> (
> FIELDTERMINATOR = '~'
> )
That should be:
BULK INSERT TBL_Master_DoNotCallList_Loader
FROM 'E:\DE_210652006.txt'
WITH
(
ROWTERMINATOR = '~'
)
ROWTERMINATOR <> FIELDTERMINATOR. You might need to specify both, but you
get the idea.
Maury|||Thanks to you both for the reply.
I had specified both row and field terminators at one point neither worked.
We now think it has something to do with the SQL server itself.
We have tried the cmd on another server and it worked fine.
Thanks again.
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
"Maury Markowitz" wrote:

> "Deasun" wrote:
>
> That should be:
> BULK INSERT TBL_Master_DoNotCallList_Loader
> FROM 'E:\DE_210652006.txt'
> WITH
> (
> ROWTERMINATOR = '~'
> )
> ROWTERMINATOR <> FIELDTERMINATOR. You might need to specify both, but you
> get the idea.
> Maury
>|||Ok I am new to this command, BULK INSERT, I cant seem to get this to work or
error out for me.
Heres what I have;
BULK INSERT TBL_Master_DoNotCallList_Loader
FROM 'E:\DE_210652006.txt'
WITH
(
FIELDTERMINATOR = '~'
)
I am running this thru QA logged in as the Admin.
The file is in the location and the date looks like so, in Notepad.
302,2066707~302,2074122~302,2076346~302,
2077647~302,2094465~
~ is the field and row terminator.
When I run above cmd I get it telling me it ran successfully.
But theres no data in table and it runs instantly.
Any help would be appreciated.
Thanks
Deasun
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.|||What is the definition of the table. Also, you didn't specify a row separato
r. Perhaps the table has
only one columns and you really want ~ as the row terminator?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Deasun" <Deasun@.discussions.microsoft.com> wrote in message
news:BCA35F53-B895-4F6A-9435-8AA493BA3338@.microsoft.com...
> Ok I am new to this command, BULK INSERT, I cant seem to get this to work
or
> error out for me.
> Heres what I have;
> BULK INSERT TBL_Master_DoNotCallList_Loader
> FROM 'E:\DE_210652006.txt'
> WITH
> (
> FIELDTERMINATOR = '~'
> )
> I am running this thru QA logged in as the Admin.
> The file is in the location and the date looks like so, in Notepad.
> 302,2066707~302,2074122~302,2076346~302,
2077647~302,2094465~
> ~ is the field and row terminator.
> When I run above cmd I get it telling me it ran successfully.
> But theres no data in table and it runs instantly.
> Any help would be appreciated.
> Thanks
> Deasun
> --
> Deasun
> Home Site: www.tirnaog.com
> Check out: The Code Vault in my forums section.|||"Deasun" wrote:

> Heres what I have;
> BULK INSERT TBL_Master_DoNotCallList_Loader
> FROM 'E:\DE_210652006.txt'
> WITH
> (
> FIELDTERMINATOR = '~'
> )
That should be:
BULK INSERT TBL_Master_DoNotCallList_Loader
FROM 'E:\DE_210652006.txt'
WITH
(
ROWTERMINATOR = '~'
)
ROWTERMINATOR <> FIELDTERMINATOR. You might need to specify both, but you
get the idea.
Maury|||Thanks to you both for the reply.
I had specified both row and field terminators at one point neither worked.
We now think it has something to do with the SQL server itself.
We have tried the cmd on another server and it worked fine.
Thanks again.
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
"Maury Markowitz" wrote:

> "Deasun" wrote:
>
> That should be:
> BULK INSERT TBL_Master_DoNotCallList_Loader
> FROM 'E:\DE_210652006.txt'
> WITH
> (
> ROWTERMINATOR = '~'
> )
> ROWTERMINATOR <> FIELDTERMINATOR. You might need to specify both, but you
> get the idea.
> Maury
>

Friday, February 24, 2012

how can i use comma like a decimal separator?

"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER?

i need help...

You would have to change your Windows collation. That is where the translation is occuring.

how can i use comma like a decimal separator?

"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER?

i need help...

hi,

SQL Server just uses "dot" as decimal separator... you have to replace your strings removing the thousands separator, if present, and modify the decimal separator as indicated..

or just use a Command object instead of dynamic SQL, so that the command parameter's value(s) will be set accordingly to your locale settings and you do not have to deal with that kind of troubles... more, you completely bypass lots of SQL injection troubles as, for instance, a datetime parameter can not accept something like

param.Value = '20060101'''; DELETE FROM other_table'

or the like... and you can better check each parameter for validity..

regards

How can i use comma like a decimal separator?

"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER?

You're in the wrong place. Go here: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=93&SiteID=1

-Jamie

how can i use comma like a decimal separator in Sql Server Express?

I need HELP

"update product set price='1,99' where cod='001'"

I need COMMA... not DOT

In oracle i use "alter session set language='Brazil'"... but... in SQL SERVER?

Moving to the "Transact-SQL" forum.|||

Take a look if maybe that will help you:

ms-help://MS.MSDNQTR.2003FEB.1033/tsqlref/ts_sp_da-di_2tk5.htm