Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-08-10 : 09:49:49
|
Herb writes "I have gone through your FAQ and was not able to find (my wife states I have trouble finding things even when they are right under my nose) all the pieces. I have created the following procedure (my first). Oh, one last thing, my DB in on a virtual machine and the “C-Drive” of the PC is mapped at the time the VM is created. So here I am trying to learn both VM and SQL Server and I have no one around to ask. Like me, they know Oracle and Informix. So SQL Server Gods can you help to let me know that: (1) if the procedure is created correctly (system states no syntax error) or could be done better (2) how to interface it with a table (DataTab) containing table names (TabName) and file names (FileName) where the data for the table is located (3) execute it to load all the tables (somewhere around 400)CREATE PROCEDURE MYspDataImport @FileName varchar(20), @TabName varchar(8) ASDECLARE @LOAD varchar(200) BEGIN SET @LOAD = "BULK INSERT TestDB.dbo.['+@TabName+'] FROM '\\tsclient\c\DATA\+@FilePath+' WITH (FIELDTERMINATOR = '|' " ENDEXEC (@LOAD)GOI think I will need to use OSQL Utility, but not sure or how to go about it. Any help will be greatly appreciated.SQL Server 2000OS: WinServer 2003PS: Is it true a stored procedure name like MYspDataImport is better than MYsp_Data_Import?Herb OverstreetMacon, GA" |
|
|
|
|