This SQL job has been working for years on SQL Server 2000. I decided to move this SQL job to SQL server 2012.
I ran the job as normal, but keep getting the following error:
Error Code: 0 Error Source= Microsoft Word Error Description: This
file could not be found. Error on Line 21. The step failed. It
cannot locate the .dot file which is on a separate server.
Am I missing something now that it's on an update server?
oA2.Open "SELECT ID, Field1, Field2, Field2 FROM tblAppMapping WHERE Field2 is NOT NULL ORDER BY ID"
Set oW = CreateObject("Word.Application")
If oA("FileID") = "2" Then
oW.Documents.Add "\\fileserver\WordTemplates\Template App V1.dot"
Else
oW.Documents.Add "\\fileserver\WordTemplates\Template App V2.dot"
End If
Looks to me like a permissions / Access issue on the file location. I would check that the file physically exists and that the Database user (Service Agent) has correct permissions to the file location.
Related
I need to copy data from one of the remote database to data base in my server. But I am getting eroor below.
insert into table_here#oprdb select * from view_on_remote#AISPRD where rownum<10;
*
ERROR at line 1:
ORA-02019: connection description for remote database not found
I also tried connecting to both before query:
conn schema/password#host:port/srvc_name;
conn schema/password#host:port/srvc_name1;
Trying the COPY command failed as well:
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
CPY-0012: Datatype cannot be copied
But still it says connection description not found.
Can anyone help me where I am getting this wrong.
Use COPY command
--connect to target db
sqlplus schema/password#host:port/oprdb
sqlplus>copy from schema/password#host:port/AISPRD insert table_here using -
select * from view_on_remote where rownum<10;
I have a database file (a .mdf file from a microsoft SQL server) that I copied on my disk. It comes from a device, and I would like to read the data, preferably in R. I am totally new to SQL, and I don't understand how to deal with a local file.
I tried
library(RMySQL)
con <- dbConnect(RMySQL::MySQL(), dbname = "MGCDBase")
which gave me
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to MySQL server on 'localhost' (0)
I don't get if it is because there is a password, if I am doing it wrong, or if I should use something else than R or RMySQL.
Any help or advise would be welcome
I'm currently using bash on CentOS. DB2 is installed and db2 is on my path.
I have a few lines in a script which are supposed to update my db2 database, but they aren't working. As a minimal reproduction, I can do the exact same thing right in the bash command line and get the same error. Here's that reproduction:
$ db2 connect to PLT02345 user uni using uni; db2 update USM_USER set STATUS = 1 where NAME = 'asm_admin'
I expect this to set STATUS to 1 for everything in PLT02345.USM_USER where the NAME is currently asm_admin.
Instead, I get an error about "ASM_ADMIN" not being valid in the context where it's used. Here's the full output:
Database Connection Information
Database server = DB2/LINUXX8664 10.1.2
SQL authorization ID = UNI
Local database alias = PLT02345
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0206N "ASM_ADMIN" is not valid in the context where it is used.
SQLSTATE=42703
I'm confused - what about this makes it not valid? Is bash somehow mutilating the command and not passing everything as it should to db2?
If you're running this from the command line, Bash will drop the 's off 'asm_admin' because it simply assumes you're passing a string. The end result is the SQL becoming WHERE name = asm_admin which is invalid.
To correct this, you need to quote your whole command:
db2 "update USM_USER set STATUS = 1 where NAME = 'asm_admin'"
I've got a SQL Server CE table like so:
...and I'm trying to update its solitary record like so:
update workTables
set fileType = "INV"
Yet I get:
Why?
UPDATE
Please see a related question here
Here check Microsoft support for yor error.
http://support.microsoft.com/kb/825392
This is from the site:
SYMPTOMS:
When you run a query on a Microsoft SQL Server 2000 Windows CE Edition version 2.0 database, and the query has a column that contains one or more space characters, the query may not be successful. Additionally, you may receive the following error message:
FAILED: select <Column Name> from <Table Name>
Error: 0x80040e14 DB_E_ERRORSINCOMMAND
Native Error: (25503)
Description: The column name is not valid. [,,,Node name (if any),Column name,]
Interface defining error: IID_ICommand
Param. 0: 0
Param. 1: 0
Param. 2: 0
Param. 3:
Param. 4: col1
Param. 5:
RESOLUTION:
To resolve this problem, enclose the column name that contains spaces in quotation marks (" "), and then run the query. For example, you can run the following query, and the query results are displayed successfully:
SELECT "col1 " FROM testtable
Your query should be:
update [workTables]
set [fileType] = 'INV'
Note: single quotes ^^^^
Search for a whole sentence in a file stored in file table using CONTAINScommand ?
For example if user enter "SQL Server" sentence I want to search for files that just contain exactly "SQL Server" not "SQL SOME TEXT Server"
I get the following error : Syntax error near 'Server' in the full-text search condition 'SQL Server'
select *
from files
where contains(file_stream,'SQL Server')
Then I try this one :
select *
from files
where contains(file_stream,'SQL AND Server')
But this returned files containing "SQL SOME TEXT Server" too.
How do I correct this?
I believe you want this:
select * from files where contains(file_stream,'"SQL Server"')
notice the double quote.