Welcome To Snipplr
Everyone's Recent SQL Snippets Tagged database
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
search database for column names
http://vyaskn.tripod.com/sql_server_search_and_replace.htm
EXEC SearchAllTables 'Computer'
GO
0
1047
posted 10 years ago by kat
Get the value of the autonumber field for the last record inserted into an Access database via the current connection.
0
1130
posted 14 years ago by wizard04
Field1 + Field2 + Field3 should create 1 entry for each unique row in the DB. In an employee table, this would be FirstName + LastName + EmployeeNumber
1
899
posted 14 years ago by ezerick
Solucion a error cuando mudamos una bd de una pc a otra y luego no podemos crear un diagrama de la BD
2
1232
posted 14 years ago by derebus
You can use this SP like that;
Exec CleanInjection 'INFECTED WORD','CLEAN WORD'
(in use : Exec CleanInjection '<script></script>','')
2
1048
posted 15 years ago by emregulcan
I had several vocabularies but wanted to merge them into one.
A simple query does this for you.
The vocabulary_id where I wanted to merge all the tags into is 3
The vocabulary_id where the tags are to be merged from is 7, 8 and 12
2
1031
posted 15 years ago by berkes
If you need to list all of the MySQL databases managed by Plesk along with their corresponding domains and login credentials, you can use this query:
1
1086
posted 15 years ago by tobewan
I am forever forgetting this. Have to look up the 101 vs 103 in books online every time.
Also forget which way around is US/NZ format. :-)
1
1236
posted 15 years ago by rengber
From StackOverflow. I'm still not quite happy with my understanding of it, but it looks an order of magnitude more elegant than most I've found.
0
1096
posted 15 years ago by rengber
This sql query will select the past version information about a given file from the database. An example would be searching for %ApprovalHistoryVOImpl% would return all past version numbers (in the database) for the ApprovalHistoryVOImpl.class file....
0
1139
posted 16 years ago by theonlyalterego
This as it sits isn't an improvement on what happens by default. It's only useful combined with a compensating transaction or sad path in the catch block, or in allowing a loop to continue.
0
1095
posted 16 years ago by rengber
Minimal syntax for cursor use. See URL for SQL 2005 options and improvements.
0
1161
posted 16 years ago by rengber
This script should be run from the "master" database. It will destroy the dev copy of a database and restore from the live copy.
Code slightly modified from original (linked).
0
940
posted 16 years ago by DaveChild
You can store an IP address in an INT UNSIGNED (4 bytes) which is of course much more efficient and faster than a CHAR(15).
MySQL has two built-in functions: INET_ATON() and INET_NTOA(). These two functions are used allover the place in any TCP/IP s...
0
1351
posted 17 years ago by zingo
You can generate a simple bar chart of the values by executing this command...
0
1140
posted 17 years ago by zingo