[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1209
  • Last Modified:

Get a Filename and put into a variable in SQL Server Query Analyzer

Is there a way to get a filename from the windows directory and put that name into a variable using xp_cmdshell commands ?

ex. c:\folder\test.csv

I just want the part of the pat that has test.csv. is it possible to collect that information in a stored procedure ?
0
Auerelio Vasquez
Asked:
Auerelio Vasquez
  • 3
  • 2
1 Solution
 
Auerelio VasquezETL DeveloperAuthor Commented:
That solution is a little more than i need. I really need to go and find out what a filename is in a directory, and pass it to the variable.....
0
 
James MurrellProduct SpecialistCommented:
0
 
Auerelio VasquezETL DeveloperAuthor Commented:
where is the part about xp_cmd shell in this blog ?
0
 
Auerelio VasquezETL DeveloperAuthor Commented:
is there anything else you can suggest ? these weren't helpful
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now