Tampilkan postingan dengan label Find. Tampilkan semua postingan
Tampilkan postingan dengan label Find. Tampilkan semua postingan
0

Perintah Dasar Google

Yap X Liong Minggu, 27 Februari 2011 , ,

Sebenarnya masih sangat banyak fitur pencarian yang bisa kita gunakan, tapi tidak terdapat di menu pilihan Advanced Search. Dengan kata lain kita harus memasukannya query di form pencarian di Basic Search langsung. Nah permainanquery dan operator pencarian ini yang sebenarnya akan kita bahas di artikel ini.
FITUR PENCARIAN DASAR
  1. AND: Mencari informasi yang mengandung kedua kata yang dicari. Bisa menggunakan salah satu dari tiga alternatif berikut:
    ukiran jepara
    ukiran AND jepara
    ukiran+jepara
  2. OR: Mencari informasi yang mengandung salah satu dari kedua kata. Bisa menggunakan salah satu dari dua alternatif berikut:
    tahu OR tempe
    tahu | tempe
  3. FRASE: Mencari informasi yang mengandung frase yang dicari dengan menggunakan tanda “”. Contoh:
    “perangkat lunak”
  4. NOT: Hasil pencarian mengandung kata yang di depan, tapi tidak yang dibelakang minus (-). Contoh di bawah akan mencari informasi yang mengandung kata ikan tapi bukan bandeng.
    ikan -bandeng
  5. SINONIM (~): Mencari kata beserta sinonim-sinonimnya. Contoh di bawah akan membawa hasil pencarian: kendaraan (car) dan sinonim-sinonimnya.
    ~car
  6. ASTERIK (*): Karakter pengganti kata. Dari contoh di bawah, hasil yang didapat bisa: ayam bakar pedas, ayam goreng pedas, ayam masak pedas, dsb
    ayam * pedas
  7. TANDA TITIK (.): Karakter pengganti huruf, angka dan karakter tunggal. Dari contoh di bawah, hasil yang didapat bisa: kopi, koki, kodi, dsb
    ko.i
  8. CASE INSENSITIVE: Pencarian di Google menganggap kapital dan bukan kapital sebagai sesuatu yang sama. Jadi, romi satria wahonoRomi Satria Wahono, atau RoMi SaTrIA waHoNo akan membawa hasil pencarian yang sama
  9. PENGABAIAN KATA: Google mengabaikan keyword berupa karakter tunggal dan kata-kata berikut: a, about, an, and, are, as, at, b, by, from, how, i , in, is, it, of, on, or, that, the, this, to, we, what, when, where, which, with. Apabila kita masih tetap menginginkan pencarian kata tersebut, bisa dengan menggunakan karakter + di depan kata yang dicari (contoh: Star Wars Episode +I), atau bisa juga dengan menganggapnya sebagai frase (contoh: “Star Wars Episode I”)
  10. I’M FEELING LUCKY: Akan membawa kita langsung menuju ke hasil pencarian pertama dari query kita
FITUR PENCARIAN LANJUT
0

Mencari Kata Tertentu di Semua Table SQL

Yap X Liong Kamis, 27 Januari 2011 , , , ,
How to search all columns of all tables in a database for a keyword?
While browsing the SQL Server newsgroups, every once in a while, I see a request for a script that can search all the columns of all the tables in a given database for a specific keyword. I never took such posts seriously. But then recently, one of my network administrators was troubleshooting a problem with Microsoft Operations Manager (MOM). MOM uses SQL Server for storing all the computer, alert and performance related information. He narrowed the problem down to something specific, and needed a script that can search all the MOM tables for a specific string. I had no such script handy at that time, so we ended up searching manually. 

That's when I really felt the need for such a script and came up with this stored procedure "SearchAllTables". It accepts a search string as input parameter, goes and searches all char, varchar, nchar, nvarchar columns of all tables (only user created tables. System tables are excluded), owned by all users in the current database. Feel free to extend this procedure to search other datatypes. 

The output of this stored procedure contains two columns: 

- 1) The table name and column name in which the search string was found 
- 2) The actual content/value of the column (Only the first 3630 characters are displayed) 

Here's a word of caution, before you go ahead and run this procedure. Though this procedure is quite quick on smaller databases, it could take hours to complete, on a large database with too many character columns and a huge number of rows. So, if you are trying to run it on a large database, be prepared to wait (I did use the locking hint NOLOCK to reduce any locking). It is efficient to use Full-Text search feature for free text searching, but it doesn't make sense for this type of ad-hoc requirements. 

Create this procedure in the required database and here is how you run it:

--To search all columns of all tables in Pubs database for the keyword "Computer" 
EXEC CariDisemuaTable 'b4r12y'
GO
 

Here is the complete stored procedure code:
 
Copyright 2010 catatan si b4r12y
Flash Blue Blogger template by b4r12y