Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
5Activity
0 of .
Results for:
No results containing your search query
P. 1
Mssql Howto

Mssql Howto

Ratings: (0)|Views: 323|Likes:
Published by Raj
How-To's of MS SQL Server
How-To's of MS SQL Server

More info:

Published by: Raj on Mar 31, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/22/2012

pdf

text

original

 
1Prepared by : Ramesh Raj
 MS SQL ServerHow-To’s
 
2Prepared by : Ramesh Raj
Contents
1) How to display Year as YYYY instead of YY
........................................................... 3
2) How to Build a Comma Delimited String from Table values
........................... 3
3) How to write values to a Text file
........................................................................... 4
4) How to add a User Defined Error Message
............................................................... 4
5) How to get the Rowcount as well as Error at the same time
...................... 5
6) How to start SQLServer in Single User Mode
........................................................ 6
7) How to start SQL Server in Minimal Configuration Mode
............................... 7
8) How to get Output parameter value from Dynamic execution of a Query
8
9) How to move Database/Transaction Log files
........................................................ 8
10) How to Rename a Database
............................................................................................... 9
11) How to move Master Database
...................................................................................... 10
12) How to Rename a Server
.................................................................................................. 10
13) How to detect & rectify Orphaned Users in a Database
............................. 11
14) How to use a Stored procedure as a Derived Table
...................................... 11
15) How to Generate Serial Numbers in a Query
...................................................... 12
16) How to Rename a Table
.................................................................................................... 12
17) How to Rename a Table Column
.................................................................................... 13
18) How to Rename a Primary Key
...................................................................................... 13
19) How to Rename a Foreign Key
...................................................................................... 13
20) How to Rename a Default
................................................................................................ 14
 
3Prepared by : Ramesh Raj
1) How to display Year as YYYY instead of YY
Enterprise Manager adopts the User's regional settings for thedate format. By default, the regional setting for the short dateformat is m/d/yy. To display it in m/d/yyyy format, follow thefollowing steps:On the taskbar, click the Start button, point to Settings andthen select Control Panel. In the Control Panel dialog boxdouble-click Regional Settings. In the Regional SettingsProperties dialog box, select the Date tab. Next, change thevalue for the Short Date Style from M/d/yy to M/d/yyyy.
2) How to Build a Comma Delimited String from Tablevalues
Sometimes you might want to return your records in a singlecomma delimited string. For example, if you have records like :-MangoBananaPeachGrapesStrawberryInstead of returning it as a recordset containing these 5records, you might want to return them as 'Mango, Banana, Peach,Grapes, Strawberry'. Here's how you can accomplish this.-- Create a temporary table & insert dummy recordsCreate Table #Fruits (Fruit Varchar(25))Insert #Fruits (Fruit) values('Mango')Insert #Fruits (Fruit) values('Banana')Insert #Fruits (Fruit) values('Peach')Insert #Fruits (Fruit) values('Grapes')Insert #Fruits (Fruit) values('Strawberry')-- Build comma delimited stringDeclare @Fruits Varchar(200)Set @Fruits = ''

Activity (5)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
ameshlal liked this
Clarrissa Cruz liked this
Sohail Abbasi liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->