|
|
-
|
|
How to rename Databasename,Tablename and Columnname.
Rename Database Name:
#Example 1
[code]
create database mytest
Exec sp_renamedb 'mytest','mytest1'
go
[/code]
#Example 2
[code]
alter database mytest mod......
|
|
-
|
|
This very simple statement allows you to count how many times a certain character appears in a string.
[code]
Select Len('///xxx') - Len(Replace('///xxx', '/', ''))
[/code]......
|
|
-
|
|
I have learned one new thing, How to move database from one location to other location using with Attach/Detach function in SQL Server.
Steps are:
1. Detach the database:
use master
go
sp_detach_db 'dbmove'
go
2. Copy the data f......
|
|
-
17 Liked
| 11 Learned
| 6 Comments
|
|
We can insert all the default values in tables without specifiying values while insert in table, how? See here we have tables defined all columns with default,
[code]
CREATE TABLE defaultval(
id int default 0,
name varchar(10)
de......
|
|
-
|
|
It is very small point but developers are unaware of it that's why i am sharing it here.
Len function in sql server returns total no of characters in any string which is passed to it as a parameter,but it excludes trailing blanks
example
select ...
|
|
-
|
|
I just learnt that, based on the frequency of data access and type of storage, there are three different categories of data.
**Hot Data**: Data that is frequently accessed and stored on high speed storage/disks.
**Warm Data**: Data that is moderat...
|
|
-
|
|
I just got started with Windows 8 on my laptop without touch and the most difficult part is how to close an app in Metro. The answer is simple ALT + F4. Or you could drag the app from the top bar all the way to the bottom to close it ( not too good)....
|
|
-
|
|
I am working a Data Quality Services Demo where i had to figure out how to write a domain rule to validate a email address. for this task, i re-learned how to write a regular expression; here's my basic version: [A-Za-z0-9._-]+@[A-Za-z0-9.-]+.[A-Za-z] ;...
|
|
-
|
|
If you want to create a row based checksum, you can use build-in functions CHECKSUM or BINARY\_CHECKSUM. Unfortunately, these functions are not precise enough - the chance to get the wrongly equal values is relatively high.
There is another function - H...
|
|
-
15 Liked
| 15 Learned
| 5 Comments
|
|
If you write a lot of dynamic TSQL queries, you might have experienced the problem of query text getting truncated when you try to print them for diagnostic purposes. A SELECT instead of PRINT will help, but you will loose formatting when the result str......
|
|