Click here to Skip to main content
15,917,176 members
Home / Discussions / Database
   

Database

 
GeneralRe: How do I make a transaction an "atomic" operation? (SQL Server 2005) Pin
Roger Wright18-Dec-09 9:07
professionalRoger Wright18-Dec-09 9:07 
GeneralRe: How do I make a transaction an "atomic" operation? (SQL Server 2005) Pin
Roger Wright18-Dec-09 9:06
professionalRoger Wright18-Dec-09 9:06 
QuestionMSSQL USE Pin
MsmVc18-Dec-09 0:24
MsmVc18-Dec-09 0:24 
AnswerRe: MSSQL USE Pin
Niladri_Biswas18-Dec-09 2:59
Niladri_Biswas18-Dec-09 2:59 
GeneralRe: MSSQL USE Pin
MsmVc18-Dec-09 17:09
MsmVc18-Dec-09 17:09 
QuestionHow to work with folder and File ? Pin
Golden Jing17-Dec-09 22:18
Golden Jing17-Dec-09 22:18 
AnswerRe: How to work with folder and File ? Pin
Ashfield17-Dec-09 23:14
Ashfield17-Dec-09 23:14 
AnswerRe: How to work with folder and File ? Pin
Niladri_Biswas17-Dec-09 23:17
Niladri_Biswas17-Dec-09 23:17 
I believe this can be done via
xp_cmdshell


In the below example I am creating a directory initially and next time if such a directory is found, I will rename that

declare 
	@cmdpath nvarchar(60)
	, @Location nvarchar(100)
	, @message nvarchar(max)
set @Location = N'C:\NewFolder'
set @cmdpath = 'MD '+ @Location

create table #result(result nvarchar(255))
insert into #result (result) exec master.dbo.xp_cmdshell @cmdpath
select @message = ISNULL(@message + ' - ','') + result from #result where result is not null
if(@message is not null)
begin
EXEC xp_cmdshell 'RENAME C:\NewFolder RenamedFolder'
end
select @message
drop table #result



For more info you can visit

a) Using xp_cmdshell[^]

b) xp_cmdshell[^]
Smile | :)

Niladri Biswas

AnswerRe: How to work with folder and File ? Pin
Mycroft Holmes17-Dec-09 23:20
professionalMycroft Holmes17-Dec-09 23:20 
GeneralRe: How to work with folder and File ? Pin
Golden Jing17-Dec-09 23:35
Golden Jing17-Dec-09 23:35 
GeneralRe: How to work with folder and File ? Pin
Mycroft Holmes18-Dec-09 0:04
professionalMycroft Holmes18-Dec-09 0:04 
GeneralRe: How to work with folder and File ? Pin
Golden Jing18-Dec-09 0:07
Golden Jing18-Dec-09 0:07 
GeneralRe: How to work with folder and File ? Pin
Niladri_Biswas18-Dec-09 2:54
Niladri_Biswas18-Dec-09 2:54 
QuestionFormat function in SQL Server Pin
Tufail Ahmad17-Dec-09 18:29
Tufail Ahmad17-Dec-09 18:29 
AnswerRe: Format function in SQL Server Pin
Niladri_Biswas17-Dec-09 20:19
Niladri_Biswas17-Dec-09 20:19 
AnswerRe: Format function in SQL Server Pin
Blue_Boy17-Dec-09 22:31
Blue_Boy17-Dec-09 22:31 
QuestionTable rows vs. comma separated Pin
Genbox17-Dec-09 5:46
Genbox17-Dec-09 5:46 
AnswerRe: Table rows vs. comma separated Pin
Member 450194017-Dec-09 8:09
Member 450194017-Dec-09 8:09 
GeneralRe: Table rows vs. comma separated Pin
Genbox17-Dec-09 8:19
Genbox17-Dec-09 8:19 
GeneralRe: Table rows vs. comma separated Pin
Member 450194017-Dec-09 10:54
Member 450194017-Dec-09 10:54 
GeneralRe: Table rows vs. comma separated Pin
Genbox17-Dec-09 12:03
Genbox17-Dec-09 12:03 
GeneralRe: Table rows vs. comma separated Pin
David Skelly17-Dec-09 22:27
David Skelly17-Dec-09 22:27 
GeneralRe: Table rows vs. comma separated Pin
Genbox18-Dec-09 11:02
Genbox18-Dec-09 11:02 
QuestionDatabase Field to contain data from a screen table Pin
RyanSmith16-Dec-09 22:52
professionalRyanSmith16-Dec-09 22:52 
AnswerRe: Database Field to contain data from a screen table Pin
Mycroft Holmes17-Dec-09 3:58
professionalMycroft Holmes17-Dec-09 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.