Wednesday, March 28, 2012
Finding data
seemed to know the answer.
Here's the question;
Is it possible to search an entire database for a string or number? If so
How?
- Hamilton
Hamilton,
You could develop your own stored procedure by iterating through the COLUNM_NAME of the system INFORMATION_SCHEMA.COLUMNS view. This will require a cursor. Any matches should also display the table name, owner and column name. A proc might exist on the we
b somewhere to do this, there is nothing native to SQL Server that will do this currently. Be aware that such a search could take a very, very long time to complete as you will be table scanning every table in your database.
Try and design your proc so that you are are only doing one table scan per table, and not one table scan per column - that should keep the already bad performance to a minimum.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
|||Thanks Mark
"Mark Allison" <marka@.no.tinned.meat.mvps.org> wrote in message
news:D3376437-D5CE-441C-8A86-3948921C9CB6@.microsoft.com...
Hamilton,
You could develop your own stored procedure by iterating through the
COLUNM_NAME of the system INFORMATION_SCHEMA.COLUMNS view. This will require
a cursor. Any matches should also display the table name, owner and column
name. A proc might exist on the web somewhere to do this, there is nothing
native to SQL Server that will do this currently. Be aware that such a
search could take a very, very long time to complete as you will be table
scanning every table in your database.
Try and design your proc so that you are are only doing one table scan per
table, and not one table scan per column - that should keep the already bad
performance to a minimum.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Finding data
seemed to know the answer.
Here's the question;
Is it possible to search an entire database for a string or number? If so
How?
- HamiltonHamilton,
You could develop your own stored procedure by iterating through the COLUNM_
NAME of the system INFORMATION_SCHEMA.COLUMNS view. This will require a curs
or. Any matches should also display the table name, owner and column name. A
proc might exist on the we
b somewhere to do this, there is nothing native to SQL Server that will do t
his currently. Be aware that such a search could take a very, very long time
to complete as you will be table scanning every table in your database.
Try and design your proc so that you are are only doing one table scan per t
able, and not one table scan per column - that should keep the already bad p
erformance to a minimum.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk|||Thanks Mark
"Mark Allison" <marka@.no.tinned.meat.mvps.org> wrote in message
news:D3376437-D5CE-441C-8A86-3948921C9CB6@.microsoft.com...
Hamilton,
You could develop your own stored procedure by iterating through the
COLUNM_NAME of the system INFORMATION_SCHEMA.COLUMNS view. This will require
a cursor. Any matches should also display the table name, owner and column
name. A proc might exist on the web somewhere to do this, there is nothing
native to SQL Server that will do this currently. Be aware that such a
search could take a very, very long time to complete as you will be table
scanning every table in your database.
Try and design your proc so that you are are only doing one table scan per
table, and not one table scan per column - that should keep the already bad
performance to a minimum.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Monday, March 12, 2012
Find out users in a particular Windows group ?
way to check through SQL which members belong to that group ? Using SQL 2000Hi Hassan,
SQL Server doesn't store which Windows users are in a Windows group. So the
only way to find out is to use the command shell with something like (I
don't know the exact syntax of the NET command):
EXEC xp_cmdshell 'NET GROUP <group name> /DOMAIN'
--
Jacco Schalkwijk
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:e5a3$$rxDHA.1996@.TK2MSFTNGP12.phx.gbl...
> We have our admins create groups containing Windows users ... Is there a
> way to check through SQL which members belong to that group ? Using SQL
2000
>
Friday, February 24, 2012
Find All Children Of A specified Group ID
I need to be able to itterate through all product menu groups in a table and find all children of a specified parent. Sorry for the cryptic Explanation and crappyDiagram!
Please see mydiagramWhat does you table(s) look like? Can you post the DDL and some sample data?|||Certainly.
Here you go.|||Have you ever looped through all directories on a drive, folder by folder by coding a function that searches all subdirectories of a single directory and calls itself on each directory that it finds?
This is what im trying to achieve here, only by using stored procedures.|||>>Have you ever...
Sure. Here are some links which should get you on your way.
http://www.sqlteam.com/item.asp?ItemID=8866
http://www.intelligententerprise.com/001020/celko1_1.jhtml?_requestid=57013|||Nice one, Ta very much indeed!
Sunday, February 19, 2012
Filtering through Matrix or groups in matrix
I have a report thats fully functional. I just want to add a filter so that my "Visits" field only displays the Visits per day that are less then 6. When i try to filter out the matrix or the group, it tells me the datatypes are different . Something about int32. Its in a matrix, but i have seen this happen in a table too, so i guessing thats not the problem. I just want to be able to display the information for Sales Reps with less then 6 Visits. Any help, will be greatlly appreciated.
Filter work fine with "=" sign so what u need to do is
fileter condition < =6 (In expression use =6 instead of plain 6)
or you may try using =cint(6)