list of Some SQL Queries?

Posted by Vpramodg under Sql Server category on | Points: 40 | Views : 2391
Here we will go through the some useful SQL Queries....

To Retrive all the Database of SQL server.

use master; select name from sysdatabases

To Retrive all the tables of SQL server.

SELECT table_name FROM   information_schema.tables

To Retrive all the DataTypes of SQL server.

select name from systypes

To Retrive all the Stored procedure of a Database with ascending order.

select name from sysobjects where  type='p' order by name asc

To delete StoredProcedure.

use dbname ; drop procedure procedurename

To BackupDatabase.
use master;BACKUP DATABASE   dbnameTO disk= pathname

To Restore Database.

use master;restore database backupfilename from disk=pathname with replace

Comments or Responses

Login to post response