April 7, 2012 at 11:48 am
Comments posted to this topic are about the item String Search
April 9, 2012 at 6:56 pm
April 9, 2012 at 7:25 pm
Thank you. I hope you find it useful.
April 9, 2012 at 7:27 pm
April 17, 2012 at 7:35 am
Hello any one can help me on. i want to search particular one table.
April 17, 2012 at 10:12 am
You can modify the code temporarily by adding at line 232:
AND O.name = 'MY_TABLE_NAME'
So something like this:
FROM
'+@v_Database_Name+N'.[sys].[schemas] S
INNER JOIN '+@v_Database_Name+N'.[sys].[objects] O ON O.[schema_id] = S.[schema_id]
AND O.[type] IN ('+(CASE
WHEN @v_Object_Types IS NOT NULL THEN @v_Object_Types
ELSE N'''U'', ''V'''
END)+N')
AND O.name = ''MY_TABLE_NAME''
INNER JOIN '+@v_Database_Name+N'.[sys].[columns] C ON C.[object_id] = O.[object_id]
April 18, 2012 at 4:40 am
Thanks for help me..
my table name contain schema name like 'abc.tablename'
when i add table name in my procedure it execute successfully after that run that procedure it's give me error
Invalid column name 'abc.tablename'.
please help me on..
can u send me Change procedure..
-----------
April 18, 2012 at 5:34 am
If you need to include the schema, then something like this should do the trick:
FROM
'+@v_Database_Name+N'.[sys].[schemas] S
INNER JOIN '+@v_Database_Name+N'.[sys].[objects] O ON O.[schema_id] = S.[schema_id]
AND O.[type] IN ('+(CASE
WHEN @v_Object_Types IS NOT NULL THEN @v_Object_Types
ELSE N'''U'', ''V'''
END)+N')
AND O.name = ''MY_TABLE_NAME''
AND S.name = ''MY_SCHEMA_NAME''
INNER JOIN '+@v_Database_Name+N'.[sys].[columns] C ON C.[object_id] = O.[object_id]
July 2, 2012 at 1:17 pm
nice little proc. thanks for sharing.
July 2, 2012 at 4:52 pm
My pleasure. Hope you find it handy.
July 16, 2013 at 5:26 pm
The procedure does not search primary key content.
July 16, 2013 at 5:33 pm
Yes it does:
USE tempdb
CREATE TABLE test (somevarchar VARCHAR (100) PRIMARY KEY CLUSTERED)
INSERT INTO test VALUES ('does it seach PK')
EXEC "database the proc is in".dbo.usp_String_Search
@v_Search_String = 'does it seach PK'
,@v_Database_Name = 'tempdb'
July 16, 2013 at 6:12 pm
I re-created the stored procedure and it is working now, but I cannot get it working with INT.
USE tempdb
CREATE TABLE test (LoanNum VARCHAR (10) PRIMARY KEY CLUSTERED, OfficeID INT )
INSERT INTO test VALUES ('100001', 1)
INSERT INTO test VALUES ('100002', 2)
INSERT INTO test VALUES ('100003', 3)
EXEC DBAdmin.dbo.usp_String_Search
@v_Search_String = '2'
,@v_Database_Name = 'tempdb'
,@v_Data_Types = N'INT'
DROP TABLE TEST
July 16, 2013 at 8:16 pm
As mentioned in the article it only checks against the following data types:
CHAR, NCHAR, NTEXT, NVARCHAR, TEXT, VARCHAR, and XML
November 28, 2013 at 7:55 am
Thanks a million.
I have one that search only one data type, but I could search for a list of values. This one will fill the gap for me.
Viewing 15 posts - 1 through 15 (of 38 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy