Can we send mail by SQLserver without using smtpserver in dot net?
How to send mail from SQL server?
With SQL Server 2005, there is no need to use MAPI client to send emails. Fellow developers who have used MAPI in the previous versions of SQL Server are well aware of the challenges it had. However i...
1. How to insert five rows in a table using single query(in ms-SQL or Oracle)2.How to delete duplicate values in a table. For example, the table containing five duplicate values(like name rani). I would like to delete all four rows in a table. But not the one row.
As suggested by krishna create table test_a(a int)insert into test_a values(1)insert into test_a values(1)insert into test_a values(3)insert into test_a values(4)insert into test_a values(5)inser...
Inset data:
insert into targettable
select top 5 * from sourcetable
delete data:
1. select distinct * into targettable from sourcetable
2. delete from sourcetable
3. insert into sourcetable
select * from targettable
What is 'no lock' term in SQL, like "select * from table a (no lock)". What is its purpose?
Define: By default select puts exclusive lock. Specifying no lock puts no lock on the table.
Advantage: Improve the peformance
Disadvantage: Dirty reads
Suggestion: Use in static table data (with fewer DML operations)
It is useful to improve the performance in executing the query. However there is a disadvantage in using it. The disadvantage is that one may not be sure that they are getting the data which is curren...
Can we call trigger inside stored procedure?
no.
Its automatically fired on DML statements.
these can not be triggered manually.
no.because,stored procedures are explicity invoked and trigger is nothing but a stored procedure but fires an event or data modifications occur.trigger is a implicity invoked.
How to join same fields of four tables at SQL server?
There are 5 types of join in sqlservercross joininner joinleft outer joinright outer joinfull outer joincross joinselect * from table1cross join table2cross join table3cross join table4inner joinselec...
select top 5 avg(rank) from table_name group by rank order by rank desc
select top 3 * from students order by average desc
Data objects are basic runtime entities.
Stored procedures,views,tables,database diagrams are the data objects
How to change rows into column and columns in to rows using SQL query in mssql?
How to insert bulk data into the SQL server?
Table to table data transfer
select * into targettable from table
flat file to table data transfer
use bcp command
bcp pubs2..publishers in pub_out -c -t , -r r
Insert data in multiple tables
How to insert data in multiple tables at same time. Using SQL server 2000
Here is the example for you question.
USE YourDB
GO
INSERT INTO
MyTable (FirstCol,
SecondCol)
SELECT First
,1
UNION ALL
SELECT Second
,2
UNION ALL
SELECT Third
,3
UNION ALL
SELECT Fourth
,4
UNION ALL
SELECT Fifth
,5
GO
insert into t1 values(,,,) insert into t2 values(,,,) insert into t3 values(,,,,)......try this ........
How to define unique key in SQL server
CREATE TABLE product(pid INT PRIMARY KEY,pname VARCHAR(10),invoiceid INT UNIQUE)
create table
(or)
alter table
Eg:
create table emp(eno int constraint uni1 unique,ename varchar(20)
To display list of tables in database
How to display list of tables from a particular database in ms-sqlhow to display description of that particular table?
To Display list of tables in the database:
SELECT * FROM INFROMATION_SCHEMA.TABLES WHERE TYPE='basetable'
To describe the structure of a particular table
SP_HELP table_name;
use
sp_help
It displays all the tables created in that database
Which index is created with primary key linear indexbinary indexclustered indexnon clustered index
Clustered Index
clustered index
Hi,
In this case, We can disable the script task at the run time but we cannot disable succeeding tasks based on the variable. I tried and got to know this. Please correct me if i am wrong.
Regards
Shree
Hi Dhara,
1. create a variable
2. assign value for variable in the script task.
3. Use expression to enable or disable the taks based on the variable values.
let me know if you have any more details.
cheers,
gnanam.
Where can I get more information on SQL server cursors? Please help...
Cursor is used to eliminate the repeated(duplicate) records in a table.
In Embedded SQl we can get
How we will access a table of one server from a stored procdure in other server?
You can access this through the following syntax
[Another Server IP].[Database Name].[Owner].[Table Name]
e.g.
[XXX.XXX.XX.XX].[myDB].[DBO].[EmployeeMaster]
By using xp_sendmail store procedure we can do this but my problem is what parameter needs to be pass to this store procedure if I want to send mail from my local machine to another user, bcos&nb...