显示标签为“cant”的博文。显示所有博文
显示标签为“cant”的博文。显示所有博文

2012年3月20日星期二

BCP Problem

Hi all,

Im using bcp utility to copy all the data from a table to file. The file is created as it is. But i cant open that bcp file. How can i open this file.

Thanks in advance,
Srinivas r.

Quote:

Originally Posted by rsrinivasan

Hi all,

Im using bcp utility to copy all the data from a table to file. The file is created as it is. But i cant open that bcp file. How can i open this file.

Thanks in advance,
Srinivas r.


What format is your output file?
This works for me (mixed authentication):
bcp <dbname>.<schema>.<table-name> out "C:\Test.dat" -c -U <user-name> -P <password> -S <server-name\instance-name>

http://msdn2.microsoft.com/en-us/library/ms162802.aspx

2012年2月13日星期一

Batch insert

I'm using ASP.net to do a Select and I want to insert all the results into a table that is stored locally
I can put an SP local but cant put on the other DB
How would i achieve this batch insert? is it possible?
thanks
MarkI am confused:confused: What is it that you need?

If you're talking about being able to do BULK INSERT from a stored procedure, you can do that, but you'll have to grant the User ID that will execute it Bulk Insert Administrator server role (bulkadmin.)|||Sorry
I have 2 tables
table 1 - remote, cant use an SP
table 2 - local, can use a SP

I do a select on Table1 and it returns the results,

I want to insert all these results into table 2

whats the best way to do that? (most efficient)

Cheers
Mark|||The problem is that the first table is really slow to access, I have a string of booking Id's i need to pass it and it keeps timing out...its the DB! its on rubbish HW and is badly designed but I cant do anything about that so I have to use the most efficent method of getting the data out, or simply copying the required records between the 2 tables

remember the rubbish DB is not local and I only have read access to it!

whats the most efficent method I should use?

thanks
Mark|||Create a stored procedure on the remote server that retrieves rows via SELECT, and call it instead of doing SELECT from your local server.

2012年2月12日星期日

Basket Analysis

Hi,
Does anyone know of any good examples of cube construction
for basket analysis, I can't seem to find much of anything
on this particular type of analysis.
Ta
Paul
You might find some interesting material here:
http://www.ralphkimball.com/html/articles.html
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Paul" <anonymous@.discussions.microsoft.com> wrote in message
news:389501c4aeec$a2c634b0$a601280a@.phx.gbl...
> Hi,
> Does anyone know of any good examples of cube construction
> for basket analysis, I can't seem to find much of anything
> on this particular type of analysis.
> Ta
> Paul

2012年2月9日星期四

Basic replication problem

I must have a fundamental lack of understanding here as i can't believe
setting replication up can be so hard!
I'm setting up transactional replication, SQL 2000. I want to replicate a
whole database but for the moment i'm trying to get it working with one
table (or any combination of tables!). I've chosen push subscription.
The snapshot agent runs ok, generating a snapshot of all the required
articles. When i start the distribution agent to push out the subscription i
always get an error. I think its because of the settings in table article
properties (what to do 'If a table named xxx exists at the Subscriber').
But no matter what i do there is always a problem. If i say keep the
existing data unchanged then i get a duplicate primary key error (why does
it try to re-insert the rows again?). If i get rid of the existing data in
whatever way it doesnt work because of referential integrity rules. I tried
doing all tables at once (all the tables that have constraints between one
another) but that has no effect.
All i want to do is update the table(s) with any changes... can't be that
hard surely?
Paul
Paul Ibison wrote:
> Paul,
> leaving the table as it is can be used if you are
> replicating to a different tablename. As far as I can tell
> for your requirements, you should choose to drop the
> existing table (if you really want to leave the table
> there as it has the same data as the publisher, then try a
> nosync initialization.)
> HTH,
> Paul Ibison
Thanks Paul, I seem to have got it working now anyway... and after messing
about with this for 2 days an hour after i posted this message.. typical!
I changed the article snapshot setting to "delete data in the existing table
that matches the row filter statement" and that has done the trick. I
expected to have to type in SQL to select all the rows in the table but i
didn't have to. So what filter statement its using i have no idea! But it
works anyway!!