Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

String Search Expand / Collapse
Author
Message
Posted Tuesday, July 16, 2013 5:26 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, November 18, 2013 5:51 PM
Points: 2, Visits: 12
The procedure does not search primary key content.
Post #1474340
Posted Tuesday, July 16, 2013 5:33 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 11:00 AM
Points: 361, Visits: 722
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'
Post #1474341
Posted Tuesday, July 16, 2013 6:12 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, November 18, 2013 5:51 PM
Points: 2, Visits: 12
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
Post #1474344
Posted Tuesday, July 16, 2013 8:16 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 11:00 AM
Points: 361, Visits: 722
As mentioned in the article it only checks against the following data types:

CHAR, NCHAR, NTEXT, NVARCHAR, TEXT, VARCHAR, and XML
Post #1474351
Posted Thursday, November 28, 2013 7:55 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, October 22, 2014 7:56 AM
Points: 16, Visits: 39
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.
Post #1518363
Posted Thursday, November 28, 2013 8:00 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 11:00 AM
Points: 361, Visits: 722
Glad you like it. :)
Post #1518365
Posted Wednesday, October 22, 2014 7:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: 2 days ago @ 12:17 AM
Points: 3, Visits: 12
Cool Script.
Would be much cooler, if it would Output the primary key and its value for each occurence...
Post #1627702
Posted Wednesday, October 22, 2014 7:35 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 11:00 AM
Points: 361, Visits: 722
Can you explain a bit more what you mean?
Post #1627707
Posted Wednesday, October 22, 2014 7:49 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 7:31 AM
Points: 298, Visits: 1,113
I like the idea of this but the only issue I have is this, If I want to run this against our production warehouse I'm not going to have rights to create a stored procedure.

Maybe later I'll look into modifying it to not be a stored procedure for what I will need.

Thanks again for the base code at least.
Post #1627714
Posted Wednesday, October 22, 2014 7:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: 2 days ago @ 12:17 AM
Points: 3, Visits: 12
Yes, it displays the
object_name, the column_name for each hit. It would be cool if it would also Display
the Name of the Primary key column for the object and its value so a further query could be formed later on.
Something like "select [pkey_name],[column_name] from [object_name] where [pkey_name]=[pkey_value]"
Post #1627718
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse