Tuesday, March 27, 2012
Grant using Query
I am using the following to create the text for granting permissions to
stored procedures:
USE Train
SELECT 'GRANT EXECUTE ON '+ name + ' TO Web_Publish'
FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
'%web_%')
Is it possible to actually grant permissions by using an SQL statement like
the following?
GRANT EXECUTE ON
SELECT name
FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
'%web_%')
TO Web_Publish
Thanks in advance,
Steven
Hi
DECLARE @.proc_name SYSNAME
DECLARE @.sql VARCHAR(4000)
SET @.proc_name = ''
WHILE 1=1
BEGIN
SET @.proc_name = (SELECT TOP 1 ROUTINE_NAME FROM
INFORMATION_SCHEMA.ROUTINES
WHERE OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME), 'IsMSShipped') = 0
-- Only user stored procedures
AND ROUTINE_TYPE = 'Procedure'
AND ROUTINE_NAME > @.proc_name
ORDER BY ROUTINE_NAME
)
IF @.proc_name IS NULL BREAK
SET @.sql = 'GRANT EXECUTE ON ' + QUOTENAME(@.proc_name) + ' TO MyUser'
EXEC (@.sql)
END
"Steven K0" <stroy@.api.com> wrote in message
news:%23KrhfbRNGHA.3944@.tk2msftngp13.phx.gbl...
> Hello,
> I am using the following to create the text for granting permissions to
> stored procedures:
> USE Train
> SELECT 'GRANT EXECUTE ON '+ name + ' TO Web_Publish'
> FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
> '%web_%')
> Is it possible to actually grant permissions by using an SQL statement
> like the following?
> GRANT EXECUTE ON
> SELECT name
> FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
> '%web_%')
> TO Web_Publish
> --
> Thanks in advance,
> Steven
>
>
Grant using Query
I am using the following to create the text for granting permissions to
stored procedures:
USE Train
SELECT 'GRANT EXECUTE ON '+ name + ' TO Web_Publish'
FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
'%web_%')
Is it possible to actually grant permissions by using an SQL statement like
the following?
GRANT EXECUTE ON
SELECT name
FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
'%web_%')
TO Web_Publish
--
Thanks in advance,
StevenHi
DECLARE @.proc_name SYSNAME
DECLARE @.sql VARCHAR(4000)
SET @.proc_name = ''
WHILE 1=1
BEGIN
SET @.proc_name = (SELECT TOP 1 ROUTINE_NAME FROM
INFORMATION_SCHEMA.ROUTINES
WHERE OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME), 'IsMSShipped') = 0
-- Only user stored procedures
AND ROUTINE_TYPE = 'Procedure'
AND ROUTINE_NAME > @.proc_name
ORDER BY ROUTINE_NAME
)
IF @.proc_name IS NULL BREAK
SET @.sql = 'GRANT EXECUTE ON ' + QUOTENAME(@.proc_name) + ' TO MyUser'
EXEC (@.sql)
END
"Steven K0" <stroy@.api.com> wrote in message
news:%23KrhfbRNGHA.3944@.tk2msftngp13.phx.gbl...
> Hello,
> I am using the following to create the text for granting permissions to
> stored procedures:
> USE Train
> SELECT 'GRANT EXECUTE ON '+ name + ' TO Web_Publish'
> FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
> '%web_%')
> Is it possible to actually grant permissions by using an SQL statement
> like the following?
> GRANT EXECUTE ON
> SELECT name
> FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
> '%web_%')
> TO Web_Publish
> --
> Thanks in advance,
> Steven
>
>sql
Grant using Query
I am using the following to create the text for granting permissions to
stored procedures:
USE Train
SELECT 'GRANT EXECUTE ON '+ name + ' TO Web_Publish'
FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
'%web_%')
Is it possible to actually grant permissions by using an SQL statement like
the following?
GRANT EXECUTE ON
SELECT name
FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
'%web_%')
TO Web_Publish
--
Thanks in advance,
StevenHi
DECLARE @.proc_name SYSNAME
DECLARE @.sql VARCHAR(4000)
SET @.proc_name = ''
WHILE 1=1
BEGIN
SET @.proc_name = (SELECT TOP 1 ROUTINE_NAME FROM
INFORMATION_SCHEMA.ROUTINES
WHERE OBJECTPROPERTY(OBJECT_ID(ROUTINE_NAME), 'IsMSShipped') = 0
-- Only user stored procedures
AND ROUTINE_TYPE = 'Procedure'
AND ROUTINE_NAME > @.proc_name
ORDER BY ROUTINE_NAME
)
IF @.proc_name IS NULL BREAK
SET @.sql = 'GRANT EXECUTE ON ' + QUOTENAME(@.proc_name) + ' TO MyUser'
EXEC (@.sql)
END
"Steven K0" <stroy@.api.com> wrote in message
news:%23KrhfbRNGHA.3944@.tk2msftngp13.phx.gbl...
> Hello,
> I am using the following to create the text for granting permissions to
> stored procedures:
> USE Train
> SELECT 'GRANT EXECUTE ON '+ name + ' TO Web_Publish'
> FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
> '%web_%')
> Is it possible to actually grant permissions by using an SQL statement
> like the following?
> GRANT EXECUTE ON
> SELECT name
> FROM sysobjects WHERE (type = 'P') AND (category = 0) AND (name LIKE
> '%web_%')
> TO Web_Publish
> --
> Thanks in advance,
> Steven
>
>
Wednesday, March 21, 2012
Grab text near match in fulltext
search matches?
We're currently showing a summary to people, which is written by the
user, but obviously does not contain the keyword someone searched for.
And people think the search results are incorrect, but if they click
through they'll find the keyword is there.
I'm thinking MS SQL is not able to do this. Is there some other
product out there that does? We're using MS SQL 2005 Ent and
ColdFusion
Thanks in advance.
You have to code your own solution.
You might want to talk to michal at devmasters.cz. He has a solution. I am
cc'ing him in this communication so he can jump in and help you.
http://www.zetainteractive.com - Shift Happens!
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Pacific Fox - Web Design Brisbane" <tacofleur@.gmail.com> wrote in message
news:63bbaacc-e8be-4280-9a98-5af5edbaa4ae@.b1g2000pra.googlegroups.com...
> Is there a way to grab a bit of text near the first word the fulltext
> search matches?
> We're currently showing a summary to people, which is written by the
> user, but obviously does not contain the keyword someone searched for.
> And people think the search results are incorrect, but if they click
> through they'll find the keyword is there.
> I'm thinking MS SQL is not able to do this. Is there some other
> product out there that does? We're using MS SQL 2005 Ent and
> ColdFusion
> Thanks in advance.
Monday, March 19, 2012
Got HTML tags in my source, but need the text only on my Report..
does anybody know how i can convince SRS to not show things like <DIV> , etc. ? Any Property of a Field or so ?
if not
2. Question :
Any Idea of how to do this in .NET programmatically ? There must be such a function !
HTML in -> Text out
Any hint would be appreciated !
best
regards
Robin
Try this: Right-click on the whitespace around the report and click on 'Properties' and then the Code tab.
In that spot put this function:
public shared function StripHTML(strInput as string) as string
Return System.Text.RegularExpressions.Regex.Replace(strInput, "<[^>]*>", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
end function
For the textbox or whatever make the expression say '=Code.StripHTML(Fields!DivTag.Value)'
This will strip anything surrounded by '<' and '>'
Let me know if this works
Slick - I like!
Google Like Full Text Search
I have a Full-Text Catalog that is populated by various columns in a few different tables. I have been able to create a stored procedure that will search across all of the different full-text columns and return me the results.
My problem is, if the someone searches for
hello world
then to my understanding I want to use FREETEXTTABLE to return my results (I actually get 0 results if I use CONTAINSTABLE)
If someone searches for
"hello world"
then I want to use CONTAINSTABLE because FREETEXTTABLE returns too many results.
And now the biggest problem would be, if someone searches for
"hello world" program
I would somehow need to use CONTAINSTABLE for the phrase and FREETEXTTABLE for 'program'. The SQL to accomplish something like this would probably be very ugly (if possible at all)
Can anyone give me any suggestions on this matter? I'm trying to create a google like search on a database which contains text and files (as BLOBs).
Thanks in advanceI should clarify a bit more.
If someone searches for
"hello world"
then I want to use CONTAINSTABLE because FREETEXTTABLE returns too many results.
The problem isn't that FREETEXTTABLE returns too many results but rather the rankings that I get back aren't helpful. Say I have 2 completely different tables and I want to search across both of them. Table1 has rows that contain the phrase "hello world" while Table2 doesn't contain that specific phrase, but does contain the separate words 'hello' and 'world'. I run FREETEXTTABLE on both Table1 and Table2, Union the results, and then return the table to my web app (where other formatting occurs before the results are displayed to the user.) Unfortunately because of how the Ranks are calculated, the entries in Table2 have a higher Rank than the entries in Table1 (even though the exact phrase occurs in Table1)
I want the rows from Table1 to appear before Table2 in this case.
One solution that I have been playing with is to always use CONTAINSTABLE, use regular expressions to insert 'AND' where applicaple, and use the 'FORMSOF(INFLECTIONAL, @.searchStr)' option. Unfortunately this seems to break when someone searches for
hello world
because I would insert an 'AND' between the words and then try to find the inflectional forms of "hello AND world" which of course breaks.
Once again, and ideas/suggestions would be greatly appreciated|||I think I've found the solution
If someone wants to search for...
"hello world" program
Then the sql would look like this...
SELECT *
FROM CONTAINSTABLE(T_Table, *, 'FORMSOF(INFLECTIONAL, "hello world") AND FORMSOF(INFLECTIONAL, "program")')|||Thanks EvilMonkey - very helpful. =)|||
cool but can u give some details.
good, thorough documentation on full text issues?
through. I am not sure if it has been posted yet
There is a problem with full-text indexed views which has surfaced recently
which does not offer the best performance. I would advise you to test.
I think we have the largest implementation of SQL FTS - we are indexing over
1.5 terrabytes.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"tbh" <femdev@.newsgroups.nospam> wrote in message
news:%23RrzTovOHHA.4992@.TK2MSFTNGP04.phx.gbl...
> hi,
> out website is starting to get serious about switching from SQL 2000 to
> SQL 2005. in the process we hope to address a few weak points in our
> site's fulltext searching.
> i'd like to find the best possible documentation or courses to get up to
> speed on this. i have googled quite extensively and found some detailed
> information, e.g. at msdn, in newsgroups, and the two fulltext articles
> here:
> http://www.simple-talk.com/author/hilary-cotter/
> (which strike me as very good as far as they go.)
> my question is whether there are good books, articles, or courses that go
> deeper still. maybe someone has assembled a list that i haven't found yet?
> in particular i'm interested in the following issues:
> - i've read that SQL 2005 promises improvements in fulltext search, but i
> haven't seen anything dramatic in my reading and testing yet [*]; (one
> example: supposedly the german noise word list was improved, but my
> impression is it's the same as before; this is no big deal, we will
> replace it with something like the 100 most frequent German words when we
> switch to 2005 -- good breaking point)
> - i'd like to learn more about language-specific issues such as how words
> are parsed and stemming is done, in particular how can i tune and test
> these
> i'd be grateful for any pointers.
> cheers,
> Tim Hanson
> [*] one quote from one of the above-sited articles is intriguing:
> Similarly a table can be full-text indexed in a single
> catalog; or to put it another way - a table's full-text
> index cannot span catalogs. However, in SQL 2005 you
> can full-text index views which may reside in different
> catalogs than the underlying base tables. This provides
> performance benefits and allows partitioning of tables.
> however i'd need to learn much more to decide whether i can benefit from
> it.
>
"tbh" <femdev@.newsgroups.nospam> wrote in message
news:eGohcdwOHHA.4484@.TK2MSFTNGP02.phx.gbl...
> thanks.
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:ut$dpGwOHHA.2312@.TK2MSFTNGP04.phx.gbl...
> hmmm. i don't find that URL. http://searchsql.target.com is there
> something missing?
Maybe he meant http://searchsqlserver.techtarget.com/? I don't think Target
Department stores has a public website for SQL Server articles... I could
be wrong though...
Friday, February 24, 2012
Global search on a databse
is there a possibility to do a global search on a wohle mssql-database to
find a specific text string?
I know for sure that there is a specific text string as plaintext (or maybe
as binary value) somewhere in a column in one of the tables - I just dont
konw in which table in which column ;-(
is there an option to do a global search on all tables of a database?
I'll appreciate any help!
Best, Jan
Vyas has a procedure for the same.
http://vyaskn.tripod.com/search_all_...all_tables.htm
Regards
Roji. P. Thomas
http://toponewithties.blogspot.com
"Jan Meier" <no@.no.com> wrote in message
news:%23F9zmaIWGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Hi Newsgroup,
> is there a possibility to do a global search on a wohle mssql-database to
> find a specific text string?
> I know for sure that there is a specific text string as plaintext (or
> maybe as binary value) somewhere in a column in one of the tables - I just
> dont konw in which table in which column ;-(
> is there an option to do a global search on all tables of a database?
> I'll appreciate any help!
> Best, Jan
>
Global search on a databse
is there a possibility to do a global search on a wohle mssql-database to
find a specific text string?
I know for sure that there is a specific text string as plaintext (or maybe
as binary value) somewhere in a column in one of the tables - I just dont
konw in which table in which column ;-(
is there an option to do a global search on all tables of a database?
I'll appreciate any help!
Best, JanHi Jan,
no need to cross language post :-)
http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--|||Vyas has a procedure for the same.
http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm
--
Regards
Roji. P. Thomas
http://toponewithties.blogspot.com
"Jan Meier" <no@.no.com> wrote in message
news:%23F9zmaIWGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Hi Newsgroup,
> is there a possibility to do a global search on a wohle mssql-database to
> find a specific text string?
> I know for sure that there is a specific text string as plaintext (or
> maybe as binary value) somewhere in a column in one of the tables - I just
> dont konw in which table in which column ;-(
> is there an option to do a global search on all tables of a database?
> I'll appreciate any help!
> Best, Jan
>
Global search on a databse
is there a possibility to do a global search on a wohle mssql-database to
find a specific text string?
I know for sure that there is a specific text string as plaintext (or maybe
as binary value) somewhere in a column in one of the tables - I just dont
konw in which table in which column ;-(
is there an option to do a global search on all tables of a database?
I'll appreciate any help!
Best, JanVyas has a procedure for the same.
http://vyaskn.tripod.com/search_all..._all_tables.htm
Regards
Roji. P. Thomas
http://toponewithties.blogspot.com
"Jan Meier" <no@.no.com> wrote in message
news:%23F9zmaIWGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Hi Newsgroup,
> is there a possibility to do a global search on a wohle mssql-database to
> find a specific text string?
> I know for sure that there is a specific text string as plaintext (or
> maybe as binary value) somewhere in a column in one of the tables - I just
> dont konw in which table in which column ;-(
> is there an option to do a global search on all tables of a database?
> I'll appreciate any help!
> Best, Jan
>