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 |
senthil4181
Starting Member
2 Posts |
Posted - 2009-04-23 : 06:58:03
|
I got this following problem below and my database is existing in my server.when i am trying to replace my select query to fetch data frominformation_schema.tables its working fine.but when i am trying this codingDECLARE @FileName varchar(100),@bcpCommand varchar(2000)SET @FileName = REPLACE('c:\authors_'+CONVERT(char(8),GETDATE(),1)+'.txt','/','-')SET @bcpCommand = 'bcp " SELECT ApplicationID, Portname, IPaddress, RootPath, BannerImagePath, PrizeImagePath, ImagePath, Description, CreatedDate FROM [eLOTTERY]..[TB_eL_ApplicationPath] " queryout "' SET @bcpCommand = @bcpCommand + @FileName + '" -c 'EXEC master..xp_cmdshell @bcpCommandi got following problemPassword: SQLState = S0002, NativeError = 208Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'eLOTTERY..TB_eL_ApplicationPath'.SQLState = 37000, NativeError = 8180Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.NULLadvance thanks for ur help |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2009-04-23 : 07:51:10
|
Try adding the schema name. i.e.[eLOTTERY]..[TB_eL_ApplicationPath]should maybe become (if dbo is your schema:[eLOTTERY].dbo.[TB_eL_ApplicationPath] |
 |
|
senthil4181
Starting Member
2 Posts |
Posted - 2009-04-23 : 08:00:36
|
i tried with this one also.[eLOTTERY].dbo.[TB_eL_ApplicationPath]Same Error:Password: SQLState = S0002, NativeError = 208Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'eLOTTERY.dbo.TB_eL_ApplicationPath'.SQLState = 37000, NativeError = 8180Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.NULLAnd i am having dbo schema only |
 |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2009-04-23 : 08:36:51
|
Can you post the result of @bcpCommand just before you execute it? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|