Ok, I know this question has been asked dozen of time. I did do some research but I encountered some difficulties. Please help me and I promise all the reward points that I have.
Below is my procedure :
1) I created a stored procedure with the following source from http://www.mssqlcity.com/Articles/KnowHow/Textcopy.htm
CREATE PROCEDURE sp_textcopy (
@.srvname varchar (30),
@.login varchar (30),
@.password varchar (30),
@.dbname varchar (30),
@.tbname varchar (30),
@.colname varchar (30),
@.filename varchar (30),
@.whereclause varchar (40),
@.direction char(1))
AS
DECLARE @.exec_str varchar (255)
SELECT @.exec_str =
'textcopy /S ' + @.srvname +
' /U ' + @.login +
' /P ' + @.password +
' /D ' + @.dbname +
' /T ' + @.tbname +
' /C ' + @.colname +
' /W "' + @.whereclause +
'" /F ' + @.filename +
' /' + @.direction
EXEC master..xp_cmdshell @.exec_str
2) Then I go to SQL Query Analyser, where I am using Windows Authenitication and select the database where my tables and the stored procedure located.
3) My database is called "paramount", table is 'movie' and has a field called "image" and its type is "image".
4) I issued this command :
sp_textcopy @.srvname = 'local',
@.login = 'test', @.password = '',
@.dbname = 'paramountSilver', @.tbname = 'movie',
@.colname = 'image',
@.filename = 'd:\paramount\antz.jpg',
@.whereclause = "title = 'antz'",
@.direction = 'I'
5) I got this message from the output panel
SQL Server Message 18452: Login failed for user 'test'. Reason: Not associated with a trusted SQL Server connection.
DB-Library Error 10003: Login incorrect.
I already created a login user from Enterprise Manager->Security->Login and set it to my database.
Please tell me what is wrong and how to rectify the error.
Thank you very much.Use one of the following workarounds:
Use trusted connections over named pipes where appropriate.
Disable multiprotocol for SQL Server using the Server Network Utility.|||Originally posted by Satya
Use one of the following workarounds:
Use trusted connections over named pipes where appropriate.
Hello boss,
Thanks for the reply. I am a total dummy in MSSQL. Could you please elaborate further on how to Use trusted connections over named pipes where appropriate?
Where should I get to or set the trusted connection?
Please enlighten me.
Thanks|||First of all read thru books online for Trusted connections information, which gives you information required.
Here is the extract from BOL:
How to set up Windows Authentication Mode security (Enterprise Manager)
New Information - SQL Server 2000 SP3.
To set up Windows Authentication Mode security
Expand a server group.
Right-click a server, and then click Properties.
On the Security tab, under Authentication, click Windows only.
Under Audit level, select the level at which user accesses to Microsoft SQL Server are recorded in the SQL Server error log:
None causes no auditing to be performed.
Success causes only successful login attempts to be audited.
Failure causes only failed login attempts to be audited.
All causes successful and failed login attempts to be audited.
Security Note Microsoft recommends auditing, at minimum, failed login attempts. Auditing failed login attempts helps determine if unauthorized users are attempting to access the system.
See Also
Authentication Modes
:cool:|||sp_textcopy @.srvname = 'DIABLO', @.login = 'sa', @.password = 'sa',
@.dbname = 'paramountSilver', @.tbname = 'movie',
@.colname = 'image',
@.filename = 'd:\paramount\antz.jpg',
@.whereclause = "title = 'antz'",
@.direction = 'I'
It looks like I have solved the login problem but now I got another message:
SQL Server 'DIABLO'Message 170: Line 1: Incorrect syntax near '='. (Concerning line 1)
DB-Library Error 10007: General SQL Server error: Check messages from the SQL Server.
Do you have any idea?|||OK. I know what's wrong. Thanks|||It would help others if you can post the your assumption to workaround this issue.
Originally posted by mpls2000
OK. I know what's wrong. Thanks|||i forgot "where".
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment