BCP Command With Arguments Having Special Chars

Jul 20, 2005

Hi all,

The command is as follows:

BCP asdos+_reports..StageCONTACTINFO OUT C:16E8.tmp -w -b10000 -t"|" -r

-Sblrkec28791dsqlserver -Uadmin -Padmin -eC:ERRCONTACTINFO.txt

Here, since the first argument(database name) has a special char '+' in
it, the command gives a syntax error. How can i escape it? Double quotes"",
[] didnt work!! Pls help!

TIA

View 1 Replies


ADVERTISEMENT

TSQL - Select First 3 Chars Where Not Special Chars

Feb 5, 2002

Say I have a column called 'NAME' in a table called 'CLIENT' and the values in NAME are Surnames or company names like:

NAME
----------------------
1-FOR-ALL
A.B. SMITH (TOOLS LTD)
BROWN
THOMSON
VW CAR SALES



I want my select to return the first 3 characters, excluding special characters (only characters between 1 and z).

In example, the following would be returned for the data above:

NAME
----------------------
1FO
ABS
BRO
THO
VWC

View 1 Replies View Related

TSQL - Select First 3 Chars Where Not Special Chars

Feb 11, 2002

Say I have a column called 'NAME' in a table called 'CLIENT' and the values in NAME are Surnames or company names like:

NAME
----------------------
1-FOR-ALL
A.B. SMITH (TOOLS LTD)
BROWN
THOMSON
VW CAR SALES



I want my select to return the first 3 characters, excluding special characters (only characters between 1 and z).

In example, the following would be returned for the data above:

NAME
----------------------
1FO
ABS
BRO
THO
VWC

View 1 Replies View Related

Want To Make A Select With Special Chars?

Jan 4, 2006

Hello,
I have a problem....
In a table i have some descriptions and i notice that at least one is as follow:

"some product 'delay' to every"

now if i try to make a insert in another table with that description i get an error...
because of the char '

is there any way to make this insert?

the database is MSSQL 2000

View 2 Replies View Related

Getting Error While Passing Values As Special Chars

Mar 4, 2008

Hi friends, I m facing an error while i m passing the values in query as special characters like (',"). anyone can help me?code will be more preferable.Thank you. 

View 1 Replies View Related

How To Deplay Reports Using Rs.exe With Special German Chars Within The Name

Feb 19, 2008



Dears,

im using a rss script and the rs.exe tool to deploy about 100 reports to several reporting server. The problem now is, that a lot of the reports a named with special german chars like Ö Ä Ü.

I am using the folowing function:



Code Snippet
rs.CreateReport(reportName, parPath, True, definition, props)




If I deploy a report name "Verträge" (=contracts), i will get an error that the report definition could not be found. But after that the report i viewable in the report server but could not be rendered.




regs,
Oliver

View 1 Replies View Related

Full-text Ignores Special Chars In Sql 2005

Oct 12, 2007

We had a sql 2000 db that had full text implemented on it. We upgrade that server to a 2005 server and now the full text searches that once worked don't. Most do work just the ones with ; or special characters in the query string don't work.

Anyone have the same behavior and how to get it to wrok again?

thanks

View 14 Replies View Related

Do Somebody Know How Long (in Chars) Script(command) Can Be Solved By SQL Command?

Aug 30, 2004

Do somebody know how long (in chars) script(command) can be solved by SQL Command?
Thanks

View 1 Replies View Related

Trim - Cannot Change Source Of Data To Strip Out Special Chars / White Space?

Feb 12, 2015

I have some sql below..

SELECT
t.Doctor, t.LedgerAmount, t.TransactionDate,
ISNULL(lg.LedgerGrpDesc, 'No Sales Group') AS LedgerGroup
FROM
Transactions t
LEFT OUTER JOIN LedgerGroups lg ON t.LedgerDescription = lg.dbLedgerDesc

[Code] .....

My problem is that the data in t.LedgerDescription sometimes now has either leading/trailing white space or more likely special chars so the join against lg.dbLedgerDesc doesn't always work.

I can't change the source of the data to strip out special chars/white space so am stuck on how to deal with it.

I tried using LTRIM & RTRIM in the where clause but this doesn't seem to have had any effect...

LEFT OUTER JOIN LedgerGroups lg ON LTRIM(RTRIM(t.LedgerDescription)) = lg.dbLedgerDesc

View 7 Replies View Related

Argument Not Specified For Parameter 'arguments' Of Public Function Select(arguments As System.Web.DatasourceSelect Arguments As Collections Ienumerable

Mar 25, 2007

I have an SqlDataSource control on my aspx page, this is connected to database by a built in procedure that returns a string dependent upon and ID passed in.
 I have the followinbg codewhich is not complet, I woiuld appriciate any help to produce the correct code for the code file
 Function GetCategoryName(ByVal ID As Integer) As String          sdsCategoriesByID.SelectParameters("ID").Direction = Data.ParameterDirection.Input          sdsCategoriesByID.SelectParameters.Item("ID").DefaultValue = 3          sdsCategoriesByID.Select() <<<< THIS LINE COMES UP WITH ERROR 1End Function
ERROR AS FOLLOWS
argument not specified for parameter 'arguments' of public function Select(arguments as System.Web.DatasourceSelect Arguments as Collections ienumerable
 
Help I have not got much more hair to loose
Thanks Steve

View 5 Replies View Related

Isql Command Line Arguments

Jun 26, 2000

Does any know of a technique to filter out headers dashes and row count in an output file of an isql result? These switches seem to be available when running as isql/w, but not the command line. The -h-1 argument for no headers had no effect. Thanks in advance. Ron Hurley

View 1 Replies View Related

Command Line Arguments In Debug Mode

Apr 24, 2007

Hi,

I am passing some /SET commands on the command line when I execute packages I created in SSIS and have run from the SQL Server Job manager. When I put these same /SET commands on the command line arguments section of the project properties page I would expect they would be passed into the executed package when it is run thru BIDS. But the variables still have their defined values when the packages executes.



Is there a trick to getting command line arguments to work in the debugger for SSIS/BIDS??


DaveM

View 4 Replies View Related

Passing Command Line Arguments From Visual Studio

Mar 27, 2006

Hi all,Is it possible to pass command line arguments to a package when running it from within VS? I want to set the value of a variable via the commandline, and found that you can to this in DtExec with the "/set Package.Variables[...].Value;..." syntax. According to the docs, you should be able to pass the same argument via the 'CmdLineArguments' property in the 'Properties' dialog of an SSIS project in VS (CmdLineArguments. Run the package with the specified command-line arguments. For information about command-line arguments, see dtexec Utility), but unfortunately, this doesn't seem to work (even though the exact same argument does work when entered in DtExec)

Any help would be greatly appreciated :-)

Steven

View 2 Replies View Related

How To Implement T-SQL Update Command Using Special Characters

Mar 24, 2008

Hi!
I wanted to execute an update command in T-SQL using some special characters like single quote ('). when i try with this it fails to accept the command. For example the text which i wanted to update is something like this "<Choice index="3" value="Don't know"/>", here i have a single quote('), less/greater than signs (<>), double quotes and forward slash (/). when i try with this type of text it fails to update, the field data type is NChar. I need help on how to successfully execute with this type of data.

Need help.


Thanks In Advance

Devloper
Anil Kumar Dwivedi

View 8 Replies View Related

Bcp Failed When Special Characters {; Were Used In The Password From Command Line In Win 2003

Jun 8, 2007

bcp worked with password in normal characters, but failed with {;"

I tried for SQL 2005 and SQL 2000, from Window 2003 SP1. Is this a bug?



When the special character { was used in the password, bcp failed with Native error 0.

>>

F:ftplogCases>bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P{
SQLState = 08001, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied
SQLState = 01S00, NativeError = 0
Warning = [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute
>>



When the special character ; or " was used in the password, bcp failed with Native error 18456.

>>

F:ftplogCases>bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P;
SQLState = 28000, NativeError = 18456
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sem5'.

F:ftplogCases>bcp "sem5.sem5.server_system_log_1" in server_system_log_1.dat
-n -Smodonald -Usem5 -P"
SQLState = 28000, NativeError = 18456
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sem5'.
>>

View 8 Replies View Related

Non English Chars Are Being Shown As Junk Chars

Jan 9, 2008

Hi All

I have loaded some data to the application using flat files

which has non english chars.

all the columns in the database are NVARCHAR type.

but in db and in application UI, the non english chars are being diplayed as junk chars. ???121

The application supports UTF-8 format

is there any setting at db level to be modified to display the non english char set as is.

Thanks

View 2 Replies View Related

Truncation Error: 255 Chars To 2 Chars.

Aug 27, 2007

Hi,

I am very new to using SSIS.

Trying to import data from MS Access 2000.

I receive the error "
[OLE DB Destination [1907]] Warning: Truncation may occur due to inserting data from data flow column "GENDER" with a length of 255 to database column "GENDER" with a length of 2. " on the source flow.

I have done some googling and came up with this post: http://torontosql.dotnetnuke-portal.com/Default.aspx?tabid=32233 which I thought may help, but it does not.

The query against the access datasource features the column: iif([sex]=1, 'm', 'f'). I tried using left(..., 2) as well, but SSIS is determind to treat the field as 255 characters for some reason.

I don't even particualrly care that the field is 255 chars and the sources is only two, I just want the data in! I have other fields coming up with similar error.

Can someone please advise?

PS, what is th significance of the "External Columns" Vs "Output Columns" on the Input and Output Properties tab in Advanced Editor?

I am really struggling with SSIS, it is not as intuitive as DTS.


View 1 Replies View Related

Remove Chars

Mar 13, 2001

I have a field name call firstname and other field middleinit, now the table contains data. and i want to extract data, the firstname field sometimes contains the middle initial, for for example JOHH D.
now I would like to set the firstname field with JOHN only and and set the middleinit field like D only
thanks

View 2 Replies View Related

Can't Contain Non-alphabetic Chars

Jun 11, 2008

With this procedure,can't show if GiftTitle contains space ,nonalphabetic chars(&,-,..) and if start with numnber.
How can i modify ??
Plz help me.
Thanks.

CREATE PROCEDURE dbo.trymatrix AS
DECLARE @SQLCommand varchar(4096), @column sysname

SET @SQLCommand = 'select c.CustomerID as Cust_ID,Name as Co_Name, ' + char(13)

DECLARE curGift CURSOR STATIC LOCAL FOR

select distinct GiftTitle from Redemption1

OPEN curGift

WHILE 1 = 1

BEGIN

FETCH curGift INTO @column

IF @@FETCH_STATUS <> 0

BREAK

SET @SQLCommand = @SQLCommand +

'sum(case GiftTitle when ''' +@column +''' then 1 else null end) as '+ @column + ','+char(13)

END

DEALLOCATE curGift

SET @SQLCommand = left (@SQLcommand, len(@SQLcommand)-2) + char(13)

SET @SQLCommand = @SQLCommand +

'from Customer c

inner join Redemption1 d

on c.CustomerID=d.CustomerID

group by Name,c.CustomerID

order by c.CustomerID'

PRINT @SQLCommand

EXEC (@SQLCommand)

View 4 Replies View Related

SqlDbType Chars's And VarChar's

Jun 19, 2006

I have an overloaded method in my data access layer that I use to load the parameters into a command object.  One of these overloaded methods is as follows:
public void LoadSqlParameter(string name, string value, ParameterDirection direction){            param                           = new SqlParameter();            param.ParameterName = name;            param.Value                 = value;            param.Direction            = direction;
            param.SqlDbType        = SqlDbType.VarChar;
            cmd.Parameters.Add(param);}
Will using a SqlDbType of VarChar cause me any problems if the actual parameter in the stored procedure is a Char? 
Am I better off leaving out the line that specifies the type?
Thanks
 
 

View 2 Replies View Related

A Textstring More Than 8000 Chars.

Feb 1, 2001

Hi,
I have a problem with a text string which is more than 8000 chars.
I am taking this string as an input from an application.so,I cannot define a local variable as text or ntext and varchar has limitation of only 8000 char.
Can anyone help me in dealing with this situation.
Also,I cannot break the string at application level.I wish if I could solve it at db level somehow?
TIA
pd

View 5 Replies View Related

Maximum Chars Per Column - 256

Sep 23, 1999

In a query Analyser, there is a provision to change the "Maximum characters per column 256 " to our size in advanced option.

It works ok.

We are using VisualInterdev for developing ASP's -- there
thro ADO - we are getting the rows from sql server 7.0 -- there data more than
256 characters are truncated.

How will i get the actual data ?.. where i can do the settings..?

help needed...

Wincy

View 2 Replies View Related

Help - Still Trying To Insert 255+ Chars Into Text

Jun 7, 1999

How do you insert more than 255 characters into a text field? or am I using READTEXT and DATALENGTH incorrectly?

I am trying to concatenate two 255 varchar strings. Both do have 255 characters of data.
I want to insert the concatenated strings into a field define as a text data type.
if I try to ' insert into tempTbl(textFieldDataType) values (@text1+@text2) it appears only the @text1 is inserted.
I have been told the data is really there, but I can only read the 256 position + with READTEXT.

DECLARE @textptr varbinary(16)
select @textptr = (select TEXTPTR(textFieldDataType) from tempTbl where pktempTbl = 33)
READTEXT tempTbl.textFieldDataType @textPtr 255 10

This should have read 10 text positions after the 255th position. However, I get msg
Msg 7124, Level 16, State 1
The offset and length specified in the READTEXT command is greater than the actual data length of 255.

If I use the datalength function, it appears to confirm that @text2 was never inserted

declare @length int
select @length = (select datalength(textFieldDataTypet) from tempTbl where pktempTbl = 33)
select @length

@length is returned as 255

View 1 Replies View Related

Odd Chars In Result From Xp_loginconfig

Sep 13, 2006

Hi

I am trying to get the domain name of the server running this instance of SQL server 2000 using xp_loginconfig but have been getting some very strange results. The code example below shows the problem quite nicely. Basically the output shows white space of some sort before the "/HelloWorld" in the second select.

Any ideas why? and how to get rid of it. I've tried using RTRIM() but that made no difference.

On some server instances I dont even see the "/HelloWorld" perhaps it's put in a new line char or something like that.

Thanks
Christian


create table #tmp (ConfigName varchar(100) null, ConfigValue varchar(100) null)
insert into #tmp exec master..xp_loginconfig

select ConfigName+'/HelloWorld' from #tmp where ConfigName = 'default domain'
select ConfigValue+'/HelloWorld' from #tmp where ConfigName = 'default domain'

drop table #tmp

GO

View 4 Replies View Related

Max Chars In A Varchar Field?

Feb 1, 2007

What's the maximum number of characters that varchar field will take? I read somewhere that it's 8k, but I may have misunderstood.

I have to potentially store 100k+ chars in a field.

What's the best way to do this?

Thanks,
--PhB

--PhB

View 1 Replies View Related

Too Many Arguments Specified!

Mar 3, 2006

Hi,I'm trying to store values from a session to sql server table. I created an sql stored procedure to pass the values into the database. For some reason when I'm running the website and trying to store value from session to database an error is being displayed with the following message "Procedure or function OrderFromCart has too many arguments specified". OrderFromCart is the name of the stored procedure. Any Ideas??ThanksInter FC

View 11 Replies View Related

Too Many Arguments Specified

Apr 6, 2006

My stored procedure: ALTER PROCEDURE [dbo].[ShortUpdateSurvey]

@s_survey_id int,
@s_survey_num varchar(10),
@s_job_address varchar(30),
@s_job_city varchar(20),
@s_client_name varchar(50),
@s_date_ordered datetime,
@s_date_required datetime,
@s_amount money

AS
SET NOCOUNT OFF;

UPDATE [survey_master]
SET
[survey_num] = @s_survey_num,
[job_address] = @s_job_address,
[job_city] = @s_job_city,
[client_name] = @s_client_name,
[date_ordered] = @s_date_ordered,
[date_required] = @s_date_required,
[amount] = @s_amount
WHERE [survey_id] = @s_survey_id My ASP code:
<asp:BoundField DataField="survey_id" HeaderText="Survey ID" SortExpression="survey_id" />
<asp:BoundField DataField="survey_num" HeaderText="Survey Num." SortExpression="survey_num" />
<asp:BoundField DataField="job_address" HeaderText="Address" SortExpression="job_address" />
<asp:BoundField DataField="job_city" HeaderText="City" SortExpression="job_city" />
<asp:BoundField DataField="client_name" HeaderText="Client" SortExpression="client_name" ReadOnly="True" />
<asp:BoundField DataField="date_ordered" HeaderText="Ordered" SortExpression="date_ordered" DataFormatString="{0:d}" HtmlEncode="False" />
<asp:BoundField DataField="date_required" HeaderText="Needed" SortExpression="date_required" DataFormatString="{0:d}" HtmlEncode="False" />
<asp:BoundField DataField="amount" HeaderText="Amount" SortExpression="amount" />
...
SelectCommand="ShortAddressSearch"
SelectCommandType="StoredProcedure"
UpdateCommand="ShortUpdateSurvey"
UpdateCommandType="StoredProcedure">
...
<UpdateParameters>
<asp:Parameter Name="s_survey_id" Type="Int32" />
<asp:Parameter Name="s_survey_num" Type="String" />
<asp:Parameter Name="s_job_address" Type="String" />
<asp:Parameter Name="s_job_city" Type="String" />
<asp:Parameter Name="s_client_name" Type="String" />
<asp:Parameter Name="s_date_ordered" Type="DateTime" />
<asp:Parameter Name="s_date_required" Type="DateTime" />
<asp:Parameter Name="s_amount" Type="Decimal" />
...
and once again, the error message:
"Procedure or function ShortUpdateSurvey has too many arguments specified."
TIA

View 3 Replies View Related

Getting First 200 Chars Of Text Stored In Variable

Apr 21, 2008

Hi all,I have a variable called Description which is set from a database field - How do i set another variable to grab the first 200 chars from this var?
hope this makes sense
 

View 2 Replies View Related

Displaying Fields Greater Than 255 Chars

Apr 29, 2001

I have a column of varchar(2000) but when I use it in a select statement I only get the first 255 characters displayed. (all the data is there as I can see different parts using substring) How do I get the complete column to display?

View 2 Replies View Related

All Text Fields Truncated To 255 Chars

Jun 25, 2006

Hi

I defined the following table in MSSQL 2000


sql Code:






Original
- sql Code





CREATE TABLE saved_query (
id INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
name VARCHAR(32) NOT NULL,
query_text VARCHAR(2048) NOT NULL
)






 CREATE TABLE saved_query (      id INT NOT NULL IDENTITY(1,1) PRIMARY KEY,      name VARCHAR(32) NOT NULL,      query_text VARCHAR(2048) NOT NULL)



and whenever I insert or update the query_text field, it's always truncated to 255 characters. Why? I clearly specified a larger field size. I also tried defining query_text as a "TEXT" but got the same result.

Thanks for any help


Ken

View 2 Replies View Related

How To Find Out The Count Of Individual Chars

May 14, 2008

Hi,
Can any one tell me
how to find out the count of individual chars in a String

ie., my string is s='ganesh kumar'
my output must be as below

Character Occurance
--------------------
g 1
a 2
n 1
e 1
s 1
h 1
k 1
u 1
m 1
r 1
----------------------

Can any one do it,
This is interview question..

Ganesh


Solutions are easy. Understanding the problem, now, that's the hard part

View 7 Replies View Related

LIKE-operator With Long Strings (over 256 Chars)

Jul 24, 2007

I am using SQL Server Compact Edition and I get an exception when running a query with a LIKE-operator which parameter is a string with length greater than 256 characters.

Has anybody had this problem? Any ideas on how to fix this?

Thanks.

View 3 Replies View Related

Searching Strings For Specific Chars ?

Nov 16, 2007

Hi if i wanna search a certain column for a specific character

so it could be '&' occuring anywhere in the string
can i use the like operator ?

so have something like

SELECT name from table
where name like '%&%'

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved