Is there a way to concatenate all the varchar values in a result set? I'm looking for an aggregate function that I could use with a group by.
Say I've got the following data.
ID FK Comment
1 1 Some string value
2 1 Some other string value
3 2...
Is it possible to get a complete list of matches made from a regular expression?
Here is an example of what I'm trying to do:
sTestStr = "exec Trace_p @Comment = 'this is a test string will it work?"
reTestRE = Regexp.new("(this|work)")
mdMatch = reTestRE.match(sTestStr)
puts mdMatch.to_a()...
I have created a batch script that creates stored procedures, alters and creates tables, etc. For a security measure I want to build in a check at the beginning of the batch file to ensure that the batch will only be run against the correct database.
Here is what I have tried:
declare...
Is there a hidden @@ variable, sp_ proc, or other feature which you can query to get the name of the current DB?
I'm looking for something like:
declare @currentDBName varchar(100)
select @currentDBName = <get current DB name>
Thanks in advance
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.