Author |
Topic |
tinamiller1
Yak Posting Veteran
78 Posts |
Posted - 2011-12-29 : 12:48:51
|
Ok, in my SQL Server 2008 I can do the following:use cin_cardiologygocreate table test(id int,firstname varchar(40),lastname varchar (40),admtdate smalldatetime)goSo that creates a table. Or I can take the .csv file and import it which does the same thing but puts in the data in that .csv file. I was trying to use the bcp utility from the command prompt to input all the data because of the size but it will not work. I get no errors and the DOS screen pops up for a few seconds and then disappears. So then I tried combining all the above code and I did this:use cin_cardiologygocreate table test(id int,firstname varchar(40),lastname varchar (40),admtdate smalldatetime)gobcp cin_cardiology.dbo.test in c:\documents and settings\desktop\test.csvgoThat does not work either. Is there a way on the bcp utility to do a create table in your main database and the bcp at the same time and why would my bcp not take all the data in the .csv and put it into the table when I run it from the utility area or try it in a script?tina m milleredit: moved to proper forum |
|
X002548
Not Just a Number
15586 Posts |
|
tinamiller1
Yak Posting Veteran
78 Posts |
Posted - 2011-12-29 : 13:31:01
|
Just an FYI, I tried opening just my command prompt by typing cmd. This way I can see what BCP is actually doing and I get this:error = microsoft sql server native client 10.0 named pipes provider could not open a connection to sql server 2 sqlstate 08001 nativeerror -2tina m miller |
|
|
tinamiller1
Yak Posting Veteran
78 Posts |
Posted - 2011-12-29 : 13:45:18
|
I tried with the -T and it gives me the above error and there is more to it. It says after all the above network related or instance specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. (I have access if I open manager and can connect no issues) check if instance name is correct (have done that) and if SQL server is configured to allow remote connection (I suspect that is the issue as I connect thru VPN to the server and I will bet that using VPN and being a telecommuter we cannot use the bcp utility unless something is turned on)tina m miller |
|
|
X002548
Not Just a Number
15586 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
tinamiller1
Yak Posting Veteran
78 Posts |
Posted - 2012-01-03 : 15:07:05
|
It is working now thank youtina m miller |
|
|
X002548
Not Just a Number
15586 Posts |
|
|