Showing posts with label varchar. Show all posts
Showing posts with label varchar. Show all posts

Wednesday, March 28, 2012

Mssql

create table ename (cid bigint,cname varchar(20),yoe bigint,domain varchar(20),special varchar(20),location varchar(20),age bigint,rsta varchar(20),percentage bigint,record varchar(20))

select cid,cname,yoe,domain,special from ename where (cid=23 and cname='Tamil' and yoe=2 and domain ='it' and special='computer' and location='chennai' and record='dotnet') or (age='' and rsta='' and percentage='')

Quote:

Originally Posted by thamilarasangc

create table ename (cid bigint,cname varchar(20),yoe bigint,domain varchar(20),special varchar(20),location varchar(20),age bigint,rsta varchar(20),percentage bigint,record varchar(20))

select cid,cname,yoe,domain,special from ename where (cid=23 and cname='Tamil' and yoe=2 and domain ='it' and special='computer' and location='chennai' and record='dotnet') or (age='' and rsta='' and percentage='')


create table ename (cid bigint,cname varchar(20),yoe bigint,domain varchar(20),special varchar(20),location varchar(20),age bigint,rsta varchar(20),percentage bigint,record varchar(20))

select cid,cname,yoe,domain,special from ename where ((cid=23 and cname='Tamil' and yoe=2 and domain ='it' and special='computer' and location='chennai' and record='dotnet') or (age='' or rsta='' or percentage=''))

Saturday, February 25, 2012

MSDTC is unavailable.

The following code:

DECLARE @.tsql varchar(1000)
CREATE TABLE #Test (...)
SET @.tsql = 'SELECT * FROM OPENQUERY(MyDataSource, ...)'
INSERT INTO #Test EXEC(@.tsql)

generates the following error message at the insert statement:

Server: Msg 8501, Level 16, State 3, Line 4
MSDTC on server 'MyComputer' is unavailable.

Why?

Thanks,
Tony Perovic
Compumation, Inc.Starting the DTC service caused the problem to go away but why does it need
it?

"tperovic" <tonyperovic@.yahoo.com> wrote in message
news:_bfLc.5403$iK.4645@.newsread2.news.atl.earthli nk.net...
> The following code:
> DECLARE @.tsql varchar(1000)
> CREATE TABLE #Test (...)
> SET @.tsql = 'SELECT * FROM OPENQUERY(MyDataSource, ...)'
> INSERT INTO #Test EXEC(@.tsql)
> generates the following error message at the insert statement:
> Server: Msg 8501, Level 16, State 3, Line 4
> MSDTC on server 'MyComputer' is unavailable.
> Why?
> Thanks,
> Tony Perovic
> Compumation, Inc.|||tperovic (tonyperovic@.yahoo.com) writes:
> Starting the DTC service caused the problem to go away but why does it
> need it?
>> DECLARE @.tsql varchar(1000)
>> CREATE TABLE #Test (...)
>> SET @.tsql = 'SELECT * FROM OPENQUERY(MyDataSource, ...)'
>> INSERT INTO #Test EXEC(@.tsql)

Because you call the other server in the context of a transaction,
defined by the INSERT statement.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp