2012年3月25日星期日
BCP Table Named "Function"
Can a table be named as "Function" in SQL 2000?
I have a table using this name. When I tried to BCP it (to extract
rows out), I got error message ".... near Function."
The BCP command I used was:
BCP mydb.dbo.function OUT d:\extract\Function.bcp -Smypc -Usa -
Pmypwd -c
Thanks in advance.
Regards,
Goh Tiam Tjai
Try brackets around the table name?
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
<gohtiamtjai@.gmail.com> wrote in message
news:963eea6a-681b-4f81-b50f-3fa3792a7a77@.q39g2000hsf.googlegroups.com...
> Dear all,
> Can a table be named as "Function" in SQL 2000?
> I have a table using this name. When I tried to BCP it (to extract
> rows out), I got error message ".... near Function."
> The BCP command I used was:
> BCP mydb.dbo.function OUT d:\extract\Function.bcp -Smypc -Usa -
> Pmypwd -c
> Thanks in advance.
>
> Regards,
> Goh Tiam Tjai
|||Thanks, Kevin.
It works with brackets:
BCP mydb.dbo.[function] OUT d:\extract\Function.bcp -Smypc -Usa
-
Pmypwd -c
Regards,
Goh Tiam Tjai
On Jan 9, 9:01 pm, "TheSQLGuru" <kgbo...@.earthlink.net> wrote:
> Try brackets around the table name?
> --
> Kevin G. Boles
> Indicium Resources, Inc.
> SQL Server MVP
> kgboles a earthlink dt net
|||You can also use the quotename() function
Sincerely,
John K
Knowledgy Consulting, LLC
knowledgy.org
Atlanta's Business Intelligence and Data Warehouse Experts
<gohtiamtjai@.gmail.com> wrote in message
news:963eea6a-681b-4f81-b50f-3fa3792a7a77@.q39g2000hsf.googlegroups.com...
> Dear all,
> Can a table be named as "Function" in SQL 2000?
> I have a table using this name. When I tried to BCP it (to extract
> rows out), I got error message ".... near Function."
> The BCP command I used was:
> BCP mydb.dbo.function OUT d:\extract\Function.bcp -Smypc -Usa -
> Pmypwd -c
> Thanks in advance.
>
> Regards,
> Goh Tiam Tjai
|||I met this kinda problem at a customer's environment while trying to set up
a Merge Replication.
Developers used "Percent" for a user-defined data type and while I was
trying to create the publication it caused lots of errors. It took some time
to find it out. However this kind of mistakes (or whatever you call it) can
take more time to find out.
Avoid using special words for your stuff.
Ekrem nsoy
<gohtiamtjai@.gmail.com> wrote in message
news:963eea6a-681b-4f81-b50f-3fa3792a7a77@.q39g2000hsf.googlegroups.com...
> Dear all,
> Can a table be named as "Function" in SQL 2000?
> I have a table using this name. When I tried to BCP it (to extract
> rows out), I got error message ".... near Function."
> The BCP command I used was:
> BCP mydb.dbo.function OUT d:\extract\Function.bcp -Smypc -Usa -
> Pmypwd -c
> Thanks in advance.
>
> Regards,
> Goh Tiam Tjai
|||"TheSQLGuru" <kgboles@.earthlink.net> wrote in message
news:13o9kt9hv3fuffd@.corp.supernews.com...
> Try brackets around the table name?
>
I think you left out the part about beating the DB designer around the head
for using a reserved name like this. :-)
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
BCP Table Named "Function"
Can a table be named as "Function" in SQL 2000?
I have a table using this name. When I tried to BCP it (to extract
rows out), I got error message ".... near Function."
The BCP command I used was:
BCP mydb.dbo.function OUT d:\extract\Function.bcp -Smypc -Usa -
Pmypwd -c
Thanks in advance.
Regards,
Goh Tiam TjaiTry brackets around the table name'
--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
<gohtiamtjai@.gmail.com> wrote in message
news:963eea6a-681b-4f81-b50f-3fa3792a7a77@.q39g2000hsf.googlegroups.com...
> Dear all,
> Can a table be named as "Function" in SQL 2000?
> I have a table using this name. When I tried to BCP it (to extract
> rows out), I got error message ".... near Function."
> The BCP command I used was:
> BCP mydb.dbo.function OUT d:\extract\Function.bcp -Smypc -Usa -
> Pmypwd -c
> Thanks in advance.
>
> Regards,
> Goh Tiam Tjai|||Thanks, Kevin.
It works with brackets:
BCP mydb.dbo.[function] OUT d:\extract\Function.bcp -Smypc -Usa
-
Pmypwd -c
Regards,
Goh Tiam Tjai
On Jan 9, 9:01 pm, "TheSQLGuru" <kgbo...@.earthlink.net> wrote:
> Try brackets around the table name'
> --
> Kevin G. Boles
> Indicium Resources, Inc.
> SQL Server MVP
> kgboles a earthlink dt net|||You can also use the quotename() function
--
Sincerely,
John K
Knowledgy Consulting, LLC
knowledgy.org
Atlanta's Business Intelligence and Data Warehouse Experts
<gohtiamtjai@.gmail.com> wrote in message
news:963eea6a-681b-4f81-b50f-3fa3792a7a77@.q39g2000hsf.googlegroups.com...
> Dear all,
> Can a table be named as "Function" in SQL 2000?
> I have a table using this name. When I tried to BCP it (to extract
> rows out), I got error message ".... near Function."
> The BCP command I used was:
> BCP mydb.dbo.function OUT d:\extract\Function.bcp -Smypc -Usa -
> Pmypwd -c
> Thanks in advance.
>
> Regards,
> Goh Tiam Tjai|||I met this kinda problem at a customer's environment while trying to set up
a Merge Replication.
Developers used "Percent" for a user-defined data type and while I was
trying to create the publication it caused lots of errors. It took some time
to find it out. However this kind of mistakes (or whatever you call it) can
take more time to find out.
Avoid using special words for your stuff.
--
Ekrem Önsoy
<gohtiamtjai@.gmail.com> wrote in message
news:963eea6a-681b-4f81-b50f-3fa3792a7a77@.q39g2000hsf.googlegroups.com...
> Dear all,
> Can a table be named as "Function" in SQL 2000?
> I have a table using this name. When I tried to BCP it (to extract
> rows out), I got error message ".... near Function."
> The BCP command I used was:
> BCP mydb.dbo.function OUT d:\extract\Function.bcp -Smypc -Usa -
> Pmypwd -c
> Thanks in advance.
>
> Regards,
> Goh Tiam Tjai|||"TheSQLGuru" <kgboles@.earthlink.net> wrote in message
news:13o9kt9hv3fuffd@.corp.supernews.com...
> Try brackets around the table name'
>
I think you left out the part about beating the DB designer around the head
for using a reserved name like this. :-)
--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.htmlsql
2012年3月6日星期二
BCP Error w/SQL 2005
command like this:
BCP Impresario.dbo.LFT_GL_POSTING(91) out c:\impftp\gl.txt -c -T -STESS3
The version of BCP.EXE that comes with SQL Server 2005 (2005.90.1399.0)
raises the following error when attempting this:
An error occurred while processing the command line.
Thanks for any help!
Adding my managed newsgroup email id.
Steven Bras
Tessitura Network, Inc.
"Tessitura Network, Inc." wrote:
> In SQL Server 2000, we were able to BCP out of a table-based function with a
> command like this:
> BCP Impresario.dbo.LFT_GL_POSTING(91) out c:\impftp\gl.txt -c -T -STESS3
> The version of BCP.EXE that comes with SQL Server 2005 (2005.90.1399.0)
> raises the following error when attempting this:
> An error occurred while processing the command line.
> Thanks for any help!
|||Try using the option of specifying a "query inside double quotes" in
place of just the the table name.
Roy Harvey
Beacon Falls, CT
On Wed, 21 Mar 2007 09:30:39 -0700, Tessitura Network, Inc. <Tessitura
Network, Inc.@.discussions.microsoft.com> wrote:
>In SQL Server 2000, we were able to BCP out of a table-based function with a
>command like this:
>BCP Impresario.dbo.LFT_GL_POSTING(91) out c:\impftp\gl.txt -c -T -STESS3
>The version of BCP.EXE that comes with SQL Server 2005 (2005.90.1399.0)
>raises the following error when attempting this:
> An error occurred while processing the command line.
>Thanks for any help!
|||Thanks! That solved the problem.
Steven Bras
Tessitura Network, Inc.
"Roy Harvey" wrote:
> Try using the option of specifying a "query inside double quotes" in
> place of just the the table name.
> Roy Harvey
> Beacon Falls, CT
> On Wed, 21 Mar 2007 09:30:39 -0700, Tessitura Network, Inc. <Tessitura
> Network, Inc.@.discussions.microsoft.com> wrote:
>
2012年2月23日星期四
BCP and Function
Hi, I have 2 questions:
1. Is it possible that I can filter out the records and only load those that I wanted during BCP loading?
I am using SQL Server 2005 and doing the bulk copying of the data from a .dat file into a SQL table.
The BCP process is working fine, but one of the column in this .dat file indicate the type of data I am getting.
One is 'T' for text, the other is 'N' for numeric. So, is it possible that I can import the data of these 2 types
separately, meaning I want to load the 'N' type first, then 'T' after, but it does not have to go in that order.
Whichever type goes first is fine, but can I filter out like we could in SQL with the where clause?
2. Is it possible to have the value returns from a function as a list of items, instead of an individual item.
for example, in query, i can say I wanted a list of cities ....where city in(select city from sometable), but
i know function only allows me to return one value (New York) for example, not the whole list of cities within the US.
so, is this possible with a function or I can only do this with stored procedure?
i have both scalar and in-line/variable table function, but none of them give me what I need.
the scalar only returns 1 value, and the table function I would still only can put in specific parameter for it to return
a list. For instance, from using my table function, I have "select * from ::fn_test(ID, city)', this mean I still
can only put in one id and one city at a time with all the columns that I specified, not a list of ID and cities.
do I make any sense? please help/advise if you can, appreciated much.
1. Not really. Better methods include using SSIS -or loading into a work table, and then having a script or stored procedure handle the data in the work table, making whatever alterations/validations/cleanups are necessary before moving the data into the production table.
2. You can create a Table Valued Function (TVF) that will return a single column table (which is a list). I suspect that you are not completely clear about how you can use that TVF. Perhaps if you created a new post, and you provided more concete information, including the table DDL, sample data in the form of INSERT statements, and a clear explanation of your desired results, we may be better able to help you. (See this link for more information about how to prepare your submission.)
2012年2月16日星期四
BC30469 Reference to a non-shared member
Function funProdName(pFields) as string
IF (IsNothing(Fields!Name.Value))
Then
Fields!ProductDescription.Value
Else
Fields!Name.Value
end Function
Basically it just replaces a column with the value in another column if
column A is null.
The exact error is:
H:\Visual Studio Projects\Report
Project1\CRM_ServiceContract_with_LineItems.rdl There is an error on line 1
of custom code: [BC30469] Reference to a non-shared member requires an object
reference.
And I have no clue as to what it means.
Thanks in advance....This doesn't work either...
Function funProdName(pFields) as string
Dim ProdName as String
IF (IsNothing(Fields!Name.Value))
Then
Prodname=Fields!ProductDescription.Value
Else
Prodname=Fields!Name.Value
end Function
"Jeff Metcalf" wrote:
> This is the function:
> Function funProdName(pFields) as string
> IF (IsNothing(Fields!Name.Value))
> Then
> Fields!ProductDescription.Value
> Else
> Fields!Name.Value
> end Function
> Basically it just replaces a column with the value in another column if
> column A is null.
> The exact error is:
> H:\Visual Studio Projects\Report
> Project1\CRM_ServiceContract_with_LineItems.rdl There is an error on line 1
> of custom code: [BC30469] Reference to a non-shared member requires an object
> reference.
> And I have no clue as to what it means.
> Thanks in advance....