emregulcan


Member since 03/01/2010

Name: Emre GULCAN

Location: Istanbul

8 snippets

View their favorites

Profile

All time reputation: 42

Achievement

first submission:submitting first snipplet

emregulcan's Recent SnippetsTagged sql



« Prev 1 Next »
  1. FAV Check SqlDataReader Column Is Exists (extension method)

    This snippet is "extension method" for IDataReader. You can use this snippet below ; I assume you have datareader like that SqlDataReader dataReader = command.ExecuteReader(); if (dataReader.IsColumnExists("columnName")) { //do something...
    C#
    posted 8 years ago emregulcan
  2. FAV SQL Inserted Trigger

    This trigger returns a resultset that includes last inserted record's guid info (uniqueidentifier) If your column is uniqueidentifier and its default value is newid() , you can't get last record id (guid) with @@identity . So, I write a trigger...
    SQL saved by 1 person
    posted 9 years ago emregulcan
  3. FAV sql Raiserror with parameters

    You can see details on http://msdn.microsoft.com/en-us/library/ms178592.aspx , but I try to explain how you throw error with "uniqueidentifier" type parameters. I convert uniqueidentifier to string (nvarchar(50)) and set a variable. "%s" is equal...
    SQL
    posted 9 years ago emregulcan
  4. FAV SQL Trim Function

    Today I need Trim() function in sql, but in Sql 2005 there is no function. Because of that I wrote this user (scalar) fuction. It's very basic; -First; it's Right Trim (RTrim()) string - And then Left Trim (LTrim())
    SQL
    posted 9 years ago emregulcan
  5. FAV Find string anywhere in Sql Database

    SQL saved by 8 people
    posted 9 years ago emregulcan
  6. FAV Timezone database

    You can run this sql scripts in your database. Firstly it creates a database and after insert records (timezones)
    SQL saved by 4 people
    posted 9 years ago emregulcan
  7. FAV Clean SQL Injection from your tables

    This snippet just updates your tables which infected "<script> </script>" code blocks. You must update all columns one by one.
    SQL saved by 6 people
    posted 9 years ago emregulcan
  8. FAV Clean Injection from Database Tables

    You can use this SP like that; Exec CleanInjection 'INFECTED WORD','CLEAN WORD' (in use : Exec CleanInjection '<script></script>','')
    SQL saved by 12 people
    posted 9 years ago emregulcan
« Prev 1 Next »