Hi all,The command is as follows:BCP asdos+_reports..StageCONTACTINFO OUT C:16E8.tmp -w -b10000 -t"|" -r-Sblrkec28791dsqlserver -Uadmin -Padmin -eC:ERRCONTACTINFO.txtHere, since the first argument(database name) has a special char '+' init, the command gives a syntax error. How can i escape it? Double quotes"",[] didnt work!! Pls help!TIA
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.
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 Ö Ä Ü.
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.
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?
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
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.
Im starting a project that will be used to reserve rooms in a building. My problem right now is writing an sql statement that will return a dataset with the proper results. I have three tables setup below. I need a dataset that returns rooms that are closed on a certain date and a set that returns open rooms on a particular date.I cant seem to figure out that sql statement... Any suggestions will be greatly appreciated. tblRooms pkRoomID fkReservationID tblDates pkDateID fkReservationID tblReservation pkReservationID fkRoomID fkDateID
I have Table1 and Table2 which are inner joined with an ID. Each record in Table1 may have up to two corresponding values in Table2, which are Type and Name.
req1- I want to select Table2.Name twice (or more), with each selection conditioned on a specific Type. req2- I also want all information pertaining to the same ID to be returned in each row req3- I want all IDs to be returned, even if Table2.Name are empty for Type1 and/or Type2.
I've got a tricky one. I'm trying to do a SELECT statement to return all of our email fields that include the Newline character, or Char(13). I've tried all of the following with no result:
WHERE Email like "%Char(13)%" WHERE charindex(Char(13), @Email) > 0 WHERE patindex(@NewLine, @Email) > 0
I've created a database : hotelselect * from hotel worksselect * from hotel where dpt='5' doesn't work : generate a errorAnyone has a explanation ?create table hotel ([hoteID] int IDENTITY (5000,1) NOT NULL,[dpt] ntext NOT NULL) ON [primary]
Could anyone help med with a select statement with a join between totables. It is to be used in a OLAP cube.I Havde table LedgerBudget and Table Admin. In table admin I can setupa from and to date and also a budgetmodel.The admin have ONE record per OLAP cube.The statement below works fine if I have stated a budgetmodel in tableAdmin.But if no budetmodel stated in table Admin, I want the statement toselect every ledgerbudget with active = 1 and allocatemethod = 0Could anyone help me with this.SELECT LTRIM(dbo.LEDGERBUDGET.ACCOUNTNUM) AS ACCOUNT_ID,dbo.LEDGERBUDGET.STARTDATE AS TRANSDATE, - dbo.LEDGERBUDGET.AMOUNT ASBUDGETFROM dbo.LEDGERBUDGET INNER JOINdbo.ADMIN ON dbo.LEDGERBUDGET.STARTDATE >=dbo.ADMIN.FROMDATE ANDdbo.LEDGERBUDGET.STARTDATE <= dbo.ADMIN.TODATEANDdbo.LEDGERBUDGET.MODELNUM =dbo.ADMIN.BUDGETMODELIDWHERE (dbo.LEDGERBUDGET.ACTIVE = 1) AND(dbo.LEDGERBUDGET.ALLOCATEMETHOD = 0)BR/Thanks
Hello, I have a question on sql stored procedures. I have such a procedure, which returnes me rows with ID-s. Then in my asp.net page I make from that Id-s a string like
SELECT * FROM [eai.Documents] WHERE CategoryId=11 OR CategoryId=16 OR CategoryId=18.
My question is: Can I do the same in my stored procedure? (without sending it to page) Here is it:
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go
ALTER PROCEDURE [dbo].[eai.GetSubCategoriesById] ( @Id int ) AS declare @path varchar(100); SELECT @path=Path FROM [eai.FileCategories] WHERE Id = @Id; SELECT Id, ParentCategoryId, Name, NumActiveAds FROM [eai.FileCategories] WHERE Path LIKE @Path + '%' ORDER BY Path
fileCategories table: (for information)Here is the screenshot of the table (10 kb )http://eai.w2o.ru/screen1.gif
I have a Managers table in my SQL DB and it has a ManagerID, MgrName and MgrPhoto field base...
I can code a form with a select button that displays a drop down with the managers in it as choices, but am a little confused as to how I would make the PHOTO (MgrPhoto) change to the corresponding ManagerID that is selected from that option drop down since the SELECT CODE in the form only queries the ManagerID / MgrName combo for the choice.. The photo is below that drop down box and how to make it change to whatever photo is assigned to the selected ManagerID / MgrName ?
Here is the form code with query :
<form enctype="multipart/form-data" action="updatemanagerphoto.php" method="POST"> <select name="ManagerID" id="manager" style="width:400px" class="form_textbox"> <? $db_connect= mysql_connect($db_host, $db_username, $db_password); mysql_select_db($db_name, $db_connect) || die(mysql_error()); $sql_query= "SELECT * FROM Managers ORDER BY MgrName ASC";
I'm having trouble creating a temp table out of a select statement that uses multipe union alls.
Here's what I have, I'm trying to get the results of this query into a temp table...
select parent, (select cst_id from co_customer (nolock) where cst_key = Parent) as cst_id, (select cst_name_cp from co_customer (nolock) where cst_key = Parent) as cst_name_cp, (select org_total_assets_ext from dbo.co_organization_ext where org_cst_key_ext = parent) as Parent_Total_assets, sum(own_assets) as Total_child_own_assets
from ( Select parent, Child, (select org_own_assets_ext from dbo.co_organization_ext where org_cst_key_ext = child) as Own_assets
from (Select Cst_key as Child, dbo.return_org_parent(cst_key,0,1) as Parent from co_customer (nolock) where cst_type = 'Organization' and cst_delete_flag = 0 and dbo.return_org_parent(cst_key,0,1) is not null union all
Select Cst_key as Child, dbo.return_org_parent(cst_key,0,2) as Parent from co_customer (nolock) where cst_type = 'Organization' and cst_delete_flag = 0 and dbo.return_org_parent(cst_key,0,2) is not null union all
Select Cst_key as Child, dbo.return_org_parent(cst_key,0,3) as Parent from co_customer (nolock) where cst_type = 'Organization' and cst_delete_flag = 0 and dbo.return_org_parent(cst_key,0,3) is not null union all
Select Cst_key as Child, dbo.return_org_parent(cst_key,0,4) as Parent from co_customer (nolock) where cst_type = 'Organization' and cst_delete_flag = 0 and dbo.return_org_parent(cst_key,0,4) is not null union all
Select Cst_key as Child, dbo.return_org_parent(cst_key,0,5) as Parent from co_customer (nolock) where cst_type = 'Organization' and cst_delete_flag = 0 and dbo.return_org_parent(cst_key,0,5) is not null union all
Select Cst_key as Child, dbo.return_org_parent(cst_key,0,6) as Parent from co_customer (nolock) where cst_type = 'Organization' and cst_delete_flag = 0 and dbo.return_org_parent(cst_key,0,6) is not null union all Select Cst_key as Child, dbo.return_org_parent(cst_key,0,7) as Parent from co_customer (nolock) where cst_type = 'Organization' and cst_delete_flag = 0 and dbo.return_org_parent(cst_key,0,7) is not null )as c ) as d
group by parent
having sum(own_assets) <> (select org_total_assets_ext from dbo.co_organization_ext where org_cst_key_ext = parent)
Dear All, i am making small web application using asp.net, C# ,sql2000. i want a about regarding how to access view or table from other server to local server. i have base database where there is a view which need to access in my database of local server.that is how to make select query to access view in other server Please help thanks
I created a query that got the following result. But I expect to get the structure like, care_nbr, cust_nbr,legal_name, address_type=physical address, addr_line_1, addr_line_2, address_type-primary address, ddr_line_1, addr_line_2. That means I only need primary and physical address, and expect them to show in a row to each care_nbr. How to perform that?
It seems when I run the query with the set staticts IO on then statistic reports back with the 'work table', and the query takes 30+ sec. if the worktable is ommited(whatever the reason?) the query take less 1 sec.
Here is my take, I believe work table is created in tempdb...and if not then whole query is using the cached page, am I right?
if I am right then the theory is, if I increase the (via sp_configure) server min memory setting and min query memory, the query ought use the cached page and return in less 1 sec. (specially there is absolutely no one but me on the server), so far I can't make it go faster...what setting am I missing to make it run faster?
Another question is if the query can not avoid but use the tempdb, is it going to always be 30 sec+ time? why is tempdb involvement make it go so much slower?
I created a query that got the following result. But I expect to get the structure like, care_nbr, cust_nbr,legal_name, address_type=physical address, addr_line_1, addr_line_2, address_type-primary address, ddr_line_1, addr_line_2. That means I only need primary and physical address, and expect them to show in a row to each care_nbr. How to perform that?
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
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)
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
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
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..?
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
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.
select ConfigName+'/HelloWorld' from #tmp where ConfigName = 'default domain' select ConfigValue+'/HelloWorld' from #tmp where ConfigName = 'default domain'
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