Grant user permission to login to the database:
USE YOUR_DB
CREATE USER ROA_NAME FOR LOGIN ROA_NAME
Add user to the group:
USER YOUR_DB
EXEC SP_ADDROLEMEMBER 'DB_DATAREADER', 'ROA_NAME'
“Members of the db_datareader fixed database role can run a SELECT statement against any table or view in the database.”
有若干情形可能导致使用用户名/密码登录失败, 其中一类便是未开启登录模式:
更详细的参考:
http://support.microsoft.com/kb/555332#method2
First we need to Config logging in SSIS package(GUI):
Two methods to generate the log:
Example:
dtexec /f DavidTest.dtsx /l “DTS.LogProviderTextFile;log.txt”
(log.txt is a Connection in SSIS package).
dtexec /f DavidTest.dtsx /cons NMT >C:/ConsoleMsg.log
About the dtexec parameters:
http://msdn.microsoft.com/en-us/library/hh231187.aspx
SSIS Logging:
http://weblogs.sqlteam.com/jamesn/archive/2008/02/11/60502.aspx
How to add Simple Logging to an SSIS Package
Use this BCP script to generate CSV file:
bcp "SELECT ''ID'', ''Username'' UNION ALL SELECT CAST(u.ID as varchar(10)),u.USERNAME from DavidTest.dbo.DavidUser u" queryout "c:\output.csv" -c -t"," -r"\n" -SServerName -T
If you want to run in SSMS, you can use:
USE MASTER
GO
DECLARE @query varchar(4000)
SET @query = '"SELECT...."';
EXEC xp_cmdshell @bcpOut
GO
for more info:
http://msdn.microsoft.com/en-us/library/aa174646(v=sql.80).aspx
We can create a new linked server using Excel:
Select the Provider, Input the data source(excel path), and provider string, keep ‘Excel 8.0’.
Save, and you can see the server .
then you can query from the new server:
SELECT * FROM DAVIDEXCEL...Sheet1$;
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.