I have a table that holds file paths for reports. Let's say it looks like this:
C:\Jeremy\Testing\JCScoobyRS\Testing.txt
Let's assume that none of the files are in the same directory and the directory is not known, as I'm running a report to get only file names. How can I get only file names from the string listed above? Thanks, JeremyBetter to store PATH & FILENAME in seperate variables.
Refer to this link (http://www.nigelrivett.net/CheckIfFileExists.html) for XP_FILEEXISTS which searches for the specified file, where you can use it for your task.
HTH|||That's my (lazy) way to do it:
declare @.FP varchar(255)
select @.FP='C:\Jeremy\Testing\JCScoobyRS\Testing.txt'
select reverse(substring(reverse(@.FP),1,charindex('\',rev erse(@.FP))-1))|||Valid tip Kukuk, keep it up.
Showing posts with label holds. Show all posts
Showing posts with label holds. Show all posts
Sunday, February 19, 2012
Get Next Number
I have a table called e_next_number that holds a variety of different IDs
currently in use. The columns are NumberType (nchar) and ID (int). My
question is, what is the best way to insure a inquire number is returned,
currently my stored procedure looks like this:
CREATE PROCEDURE _GetNextNumber
@.NumberType nchar(10),
@.NextNumber int OUTPUT
AS
SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype = @.NumberType
UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
return
TIADisregard, I posted in the wrong group. Sorry.
"MikeB" <m@.nospam.com> wrote in message
news:uj6gBrHrHHA.3636@.TK2MSFTNGP06.phx.gbl...
>I have a table called e_next_number that holds a variety of different IDs
>currently in use. The columns are NumberType (nchar) and ID (int). My
>question is, what is the best way to insure a inquire number is returned,
>currently my stored procedure looks like this:
> CREATE PROCEDURE _GetNextNumber
> @.NumberType nchar(10),
> @.NextNumber int OUTPUT
> AS
> SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype => @.NumberType
> UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
> return
> TIA
>
>
currently in use. The columns are NumberType (nchar) and ID (int). My
question is, what is the best way to insure a inquire number is returned,
currently my stored procedure looks like this:
CREATE PROCEDURE _GetNextNumber
@.NumberType nchar(10),
@.NextNumber int OUTPUT
AS
SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype = @.NumberType
UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
return
TIADisregard, I posted in the wrong group. Sorry.
"MikeB" <m@.nospam.com> wrote in message
news:uj6gBrHrHHA.3636@.TK2MSFTNGP06.phx.gbl...
>I have a table called e_next_number that holds a variety of different IDs
>currently in use. The columns are NumberType (nchar) and ID (int). My
>question is, what is the best way to insure a inquire number is returned,
>currently my stored procedure looks like this:
> CREATE PROCEDURE _GetNextNumber
> @.NumberType nchar(10),
> @.NextNumber int OUTPUT
> AS
> SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype => @.NumberType
> UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
> return
> TIA
>
>
Get Next Number
I have a table called e_next_number that holds a variety of different IDs
currently in use. The columns are NumberType (nchar) and ID (int). My
question is, what is the best way to insure a inquire number is returned,
currently my stored procedure looks like this:
CREATE PROCEDURE _GetNextNumber
@.NumberType nchar(10),
@.NextNumber int OUTPUT
AS
SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype =
@.NumberType
UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
return
TIA
Disregard, I posted in the wrong group. Sorry.
"MikeB" <m@.nospam.com> wrote in message
news:uj6gBrHrHHA.3636@.TK2MSFTNGP06.phx.gbl...
>I have a table called e_next_number that holds a variety of different IDs
>currently in use. The columns are NumberType (nchar) and ID (int). My
>question is, what is the best way to insure a inquire number is returned,
>currently my stored procedure looks like this:
> CREATE PROCEDURE _GetNextNumber
> @.NumberType nchar(10),
> @.NextNumber int OUTPUT
> AS
> SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype =
> @.NumberType
> UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
> return
> TIA
>
>
currently in use. The columns are NumberType (nchar) and ID (int). My
question is, what is the best way to insure a inquire number is returned,
currently my stored procedure looks like this:
CREATE PROCEDURE _GetNextNumber
@.NumberType nchar(10),
@.NextNumber int OUTPUT
AS
SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype =
@.NumberType
UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
return
TIA
Disregard, I posted in the wrong group. Sorry.
"MikeB" <m@.nospam.com> wrote in message
news:uj6gBrHrHHA.3636@.TK2MSFTNGP06.phx.gbl...
>I have a table called e_next_number that holds a variety of different IDs
>currently in use. The columns are NumberType (nchar) and ID (int). My
>question is, what is the best way to insure a inquire number is returned,
>currently my stored procedure looks like this:
> CREATE PROCEDURE _GetNextNumber
> @.NumberType nchar(10),
> @.NextNumber int OUTPUT
> AS
> SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype =
> @.NumberType
> UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
> return
> TIA
>
>
Get Next Number
I have a table called e_next_number that holds a variety of different IDs
currently in use. The columns are NumberType (nchar) and ID (int). My
question is, what is the best way to insure a inquire number is returned,
currently my stored procedure looks like this:
CREATE PROCEDURE _GetNextNumber
@.NumberType nchar(10),
@.NextNumber int OUTPUT
AS
SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype =
@.NumberType
UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
return
TIADisregard, I posted in the wrong group. Sorry.
"MikeB" <m@.nospam.com> wrote in message
news:uj6gBrHrHHA.3636@.TK2MSFTNGP06.phx.gbl...
>I have a table called e_next_number that holds a variety of different IDs
>currently in use. The columns are NumberType (nchar) and ID (int). My
>question is, what is the best way to insure a inquire number is returned,
>currently my stored procedure looks like this:
> CREATE PROCEDURE _GetNextNumber
> @.NumberType nchar(10),
> @.NextNumber int OUTPUT
> AS
> SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype =
> @.NumberType
> UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
> return
> TIA
>
>
currently in use. The columns are NumberType (nchar) and ID (int). My
question is, what is the best way to insure a inquire number is returned,
currently my stored procedure looks like this:
CREATE PROCEDURE _GetNextNumber
@.NumberType nchar(10),
@.NextNumber int OUTPUT
AS
SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype =
@.NumberType
UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
return
TIADisregard, I posted in the wrong group. Sorry.
"MikeB" <m@.nospam.com> wrote in message
news:uj6gBrHrHHA.3636@.TK2MSFTNGP06.phx.gbl...
>I have a table called e_next_number that holds a variety of different IDs
>currently in use. The columns are NumberType (nchar) and ID (int). My
>question is, what is the best way to insure a inquire number is returned,
>currently my stored procedure looks like this:
> CREATE PROCEDURE _GetNextNumber
> @.NumberType nchar(10),
> @.NextNumber int OUTPUT
> AS
> SELECT @.NextNumber = ID + 1 FROM e_next_number WHERE numbertype =
> @.NumberType
> UPDATE e_next_number SET ID = @.NextNumber WHERE numbertype = @.NumberType
> return
> TIA
>
>
Subscribe to:
Posts (Atom)