Showing posts with label plz. Show all posts
Showing posts with label plz. Show all posts

Wednesday, March 21, 2012

Plz, what is the most "correct" method

Hi,

Given 2 tables:

Table1:
id Auto,int,PrimKey
table2id int
txt nvarchar50

Table2:
id Auto,int,PrimKey
order int

The scenario: Table2.order defines how the table1.txt is should be ordered.
Table1.table2id contains the id of the order. This cannot be changed :(

How do I select all Table1.txt values but ordered by their corresponding
values of the table2.order field?

--
Thx,
PipHans

--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 01-09-2003Hi

The following should do what you require:

SELECT T1.id, T1.txt
FROM Table1 T1 JOIN Table2 T2 ON T1.Table2Id = T2.id
ORDER BY T2.order
John

"PipHans" <piphans@.hotmail.co> wrote in message
news:3f5f47c2$0$48896$edfadb0f@.dtext02.news.tele.d k...
> Hi,
> Given 2 tables:
> Table1:
> id Auto,int,PrimKey
> table2id int
> txt nvarchar50
> Table2:
> id Auto,int,PrimKey
> order int
> The scenario: Table2.order defines how the table1.txt is should be
ordered.
> Table1.table2id contains the id of the order. This cannot be changed :(
> How do I select all Table1.txt values but ordered by their corresponding
> values of the table2.order field?
> --
> Thx,
> PipHans
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.516 / Virus Database: 313 - Release Date: 01-09-2003|||John Bell wrote:
> SELECT T1.id, T1.txt
> FROM Table1 T1 JOIN Table2 T2 ON T1.Table2Id = T2.id
> ORDER BY T2.order

It complains about the from-clause being wrong.
If I add "LEFT JOIN" instead of "JOIN", it runs like it should. (thx btw :)

Can you explain why it didnt run with just "join"?

--
Pip

--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 01-09-2003|||Hi

A LEFT JOIN would be all rows in the left hand side table (Table1) with any
matching rows in the right hand table (Table2) therefore an entry in Table2
does not have to exist. If an entry in Table2 does not exist then NULL
values are returned.

JOIN (or INNER JOIN) is where both tables have to contain the joined data.

As you didn't post the offending query or the actual error message, the only
thing I can imaging is some other syntax error:

SELECT T1.id, T1.txt
FROM Table1 T1 LEFT JOIN Table2 T2 ON T1.Table2Id = T2.id
ORDER BY T2.order

Should work OK.

John

"PipHans" <piphans@.hotmail.co> wrote in message
news:3f5f7147$0$48899$edfadb0f@.dtext02.news.tele.d k...
> John Bell wrote:
> > SELECT T1.id, T1.txt
> > FROM Table1 T1 JOIN Table2 T2 ON T1.Table2Id = T2.id
> > ORDER BY T2.order
> It complains about the from-clause being wrong.
> If I add "LEFT JOIN" instead of "JOIN", it runs like it should. (thx btw
:)
> Can you explain why it didnt run with just "join"?
> --
> Pip
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.516 / Virus Database: 313 - Release Date: 01-09-2003|||PipHans (piphans@.hotmail.co) writes:
> John Bell wrote:
>> SELECT T1.id, T1.txt
>> FROM Table1 T1 JOIN Table2 T2 ON T1.Table2Id = T2.id
>> ORDER BY T2.order
> It complains about the from-clause being wrong.
> If I add "LEFT JOIN" instead of "JOIN", it runs like it should.
> (thx btw :)
> Can you explain why it didnt run with just "join"?

Since what John suggested is legal syntax in SQL Server (save that
he should have put the last "order" in brackets), I suspect that
you are not using SQL Server, but some other DB engine.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Erland Sommarskog wrote:
> Since what John suggested is legal syntax in SQL Server (save that
> he should have put the last "order" in brackets), I suspect that
> you are not using SQL Server, but some other DB engine.

True, I only tested on Access. - The SQL server cant be reached from home :)

--
/Pip

--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 01-09-2003|||John Bell wrote:
> Should work OK.

Yep. It worked on the SQL server at work...I only tested it on access
yesterday.

Thx :)

--
Pip

--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 01-09-2003|||PipHans (piphans@.hotmail.co) writes:
> True, I only tested on Access. - The SQL server cant be reached from home

While both Access and SQL Server both claim to run SQL, there are
significant differences between the two - as there is about between
any pair of DBMSs.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

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

Plz Tell me what I did wrong...

I have a column in my crystal report(of VB.Net 2005),this column is a Balance where there's fo example '1000 C' or '1000D' in the page footer I want the sum of this column,since it's type is string because of the letters Cr and Db I created a formula,named SumBalance:

numberVar SumBalance;
SumBalance:=0;
whilereadingrecords;
if Right({StatOfAcc.Balance}, 1)="C" then
SumBalance=SumBalance-ToNumber(Left ({StatOfAcc.Balance},Length ({StatOfAcc.Balance})-2 ))
else
SumBalance= +ToNumber(Left ({StatOfAcc.Balance},Length ({StatOfAcc.Balance}) -2));

I had put this formula in the page footer it gave me False,and if I right click,
FormatObject,I find a tab Boolean,where did I specify that my formula is a boolean...Wher's my error...Plz Tell meI knew my wrong it's that I have to write
SumBalance := not SumBalance=

But this formula is not doing what I'm expecting to do,it give me the last Balance but I need the sum of all the line of the column Balance...|||You put the formula in the page footer, so it'll run once per page and it'll only work on the last record for the page.
If you move it to the detail section (where it should be to work on every record) you shouldn't reset SumBalance to 0 every time in the 2nd line, you should create a new formula for the page header to do this. You'll then need another formula for the page footer to display the balance.
Does a balance of 0 have either C or D after it?
Do you really want to subtract Credits and add Debits?
Your previous post said you had Cr or Db on the end of the balance, and this formula half says that too - you are checking the rightmost character for 'C' but then discarding the rightmost two characters to get the number.
And finally, what's the business logic in summing a balance field?

Plz solve this Query

chiranjeevi
raveendra
sreenivasarao
koteswar
manoj
sangeetharanika

Here my query is
in the above names i want to find out the persons whoz names consist of exact 2 a's
eg output:
raveendra

assume that the names are ename and table name is emp.

Thanks in advance
Plz mail this qury to chiru_y2k@.yahoo.com

ChiranjeeviOriginally posted by chiru_y2k
chiranjeevi
raveendra
sreenivasarao
koteswar
manoj
sangeetharanika

Here my query is
in the above names i want to find out the persons whoz names consist of exact 2 a's
eg output:
raveendra

assume that the names are ename and table name is emp.

Thanks in advance
Plz mail this qury to chiru_y2k@.yahoo.com

Chiranjeevi


select * from emp where patindex('%a%',ename) =2|||Borowing a page from Brett here...

select ename
from emp
where len(replace(ename, 'a', '') + 2 = len(ename)

plz solve for this tasks

could some one help in giveing solution for this tasks..
[CODE]
Task 1 : Get the first day and last day of the week

Ex: input : '04/12/2006'

Required ouput :

start_date End_date
04/09/2006 04/15/2006

Note : 1. start_date should be sunday
2. end_date should be saturday

Task 2 -- Find the product sales week wise

Find the product sales week wise

Output Required:

gasstationID productClass week1 week2 week3 week4
------- ---- ---- ---- ---- ----
111 DSL 1 0 0 0
111 GAS 2 0 1 1
222 DSL 1 0 1 1
222 GAS 1 0 0 0

create table trial_sales(
gasstationID bigint,
salesDate smalldatetime,
gallons bigint,
productClass varchar(4))

insert into trial_sales values(111,'11/01/2005',10000,'GAS')
insert into trial_sales values(111,'11/02/2005',1000,'GAS')
insert into trial_sales values(111,'11/02/2005',20000,'DSL')
insert into trial_sales values(222,'11/01/2005',10000,'GAS')
insert into trial_sales values(222,'11/02/2005',10000,'DSL')
insert into trial_sales values(111,'11/15/2005',1000,'GAS')
insert into trial_sales values(222,'11/15/2005',10000,'DSL')
insert into trial_sales values(111,'11/25/2005',1000,'GAS')
insert into trial_sales values(222,'11/25/2005',10000,'DSL')

Task 3 Display unique values

Display unique values in

create table t (colA varchar(25))

insert into t values('apple')
insert into t values('bat')
insert into t values('car')

ouput required:

a
b
c
e
l
p
r
t

Task : 4

I have a table in the database I am working with with the following columns:
(I have simplified this down for the sake of clarity)
int p1
int p2
int p3
int s1
date d1
string s1

There is no primary key and the table more resembles a log than anything.
e.g.

p1 p2 p3 s1 d1 s1
1 12 14 100 23May comment 2
1 12 14 800 22May comment 1
1 12 14 300 24May comment 3
1 12 15 100 22May comment 2
1 12 15 800 21May comment 1
2 12 15 100 23May comment 1

What I want to do is exttract the rows from the table where the combination
of p1 p2 and p3 is distinct/unique and the date is the most recent one for
all combinations of p1, p2, p3. So from the table above I would end up with
the resultset:

p1 p2 p3 s1 d1 s1
1 12 14 300 24May comment 3
1 12 15 100 22May comment 2
2 12 15 100 23May comment 1

Task 5

say i have the following data...
uId(int PK), productcode(int), quantity(int)
1,12,5
2,12,3
3,12,5
4,11,9

...and i have an order for productcode 12 with quantity of 6 products.
i need to select only enough rows to reach a quantity of 6.
in this case, i would want the first two rows which would give me a sum of
8.
how can i do this without looping through each record, getting the quantity
and exiting the loop when i have a sum >= 6?

Task 6

I have two tables as below, TABLE1 and TABLE2.

TABLE 1: Base

ID PName PPrice
------------
1 A 30
2 B 20

TABLE 2: History

ID Ldate Amount
------------
1 2005/8/7 50

The ID of TALBE1 is the primary key and the ID of TABLE2 is the foreign key.
What's the right T-SQL JOIN statement when I pass the date of 2005/8/7,
it will return the result as below:

Ldate PName Amount
-----------
2005/8/7 A 50
2005/8/7 B null

and when I pass the date of 2005/8/8, it will return the result as below:

Ldate PName Amount
-----------
2005/8/8 A null
2005/8/8 B null

Task : 7

Reverse the Name

create table sample_judge(
judge_name varchar(50))
go

insert into sample_judge values ('J Smith')
insert into sample_judge values ('M Samuel')
insert into sample_judge values ('S Shan')
insert into sample_judge values ('K Anand')
insert into sample_judge values ('K K K K Anand')
insert into sample_judge values ('K R Shanth Anand')
insert into sample_judge values ('K R Shanth Anand Kumara Velu')

go

Expected Output :

Smith J
Samuel M
Shan S
Anand K
Anand K K K K
Shanth Anand K R
Shanth Anand Kumara Velu K R

[\CODE]

thanks in adv
chakricould some one help in giveing solution for this tasks..no, because we don't do homework assignments

but we would be happy to help you do your assignment, one question at a time

;)

Task 1 : Get the first day and last day of the week

feed the given date into the DATEPART function using weekday (dw) datepart The weekday (dw) datepart returns a number that corresponds to the day of the week, for example: Sunday = 1, Saturday = 7. The number produced by the weekday datepart depends on the value set by SET DATEFIRST, which sets the first day of the week.then subtract this weekday number minus 1 from the given date using DATEADD function with day parameter

this gives you the first day of the week for the given date

for the last day of the week, add 6 days to the first day of the week

when you have understood this, and have written your solultion to task 1, you will be ready to tackle task 2|||thanks for your help, well can i know about this

create table t (colA varchar(25))

insert into t values('apple')
insert into t values('bat')
insert into t values('car')

ouput required:

a
b
c
e
l
p
r
t

thanks in adv.,
chakri|||i will give you a hint: you need to extract 1-character substrings of a string value

do you know of any function that can extract substrings?

hint: SUBSTRING

:)|||thank you..for your help..|||What was your solution? I have one floating about in my noodle but I am curious how you solved it :)

Plz help-Yukon and WebServices

Hi,
Please let me know how can I add a reference to my WebService in the
Business Intelligence Studio for Yukon Reports. I would like my reports to
be populated from a webservice method. Cant find any step by step
information.
Thanks,
ShafiaOn Mon, 18 Apr 2005 16:45:54 +0500, "Shafia" <sbatool@.ultimus.com>
wrote:
>Hi,
>Please let me know how can I add a reference to my WebService in the
>Business Intelligence Studio for Yukon Reports. I would like my reports to
>be populated from a webservice method. Cant find any step by step
>information.
>
>Thanks,
>Shafia
Shafia,
Questions about SQL Server 2005 Reporting Services are probably best
asked on the microsoft.private.sqlserver2005.reportingsvcs newsgroup.
Despite its name it's publicly accessible.
Andrew Watt
MVP - InfoPathsql

PLZ help: problem with a certain query

I have this easy query , but the MSSQL server give me an error (Incorrect syntax near ',')

my query is:

--

SELECT Book_Name FROM Books

WHERE (Year,Faculty) =

(SELECT Year,Faculty FROM Books

WHERE Book_Id =100);

--

its seems the error because this line: WHERE (Year,Faculty) =

I don't what the problem!! this query is legal in mysql but not in mssql.

when I tried this one:

SELECT Book_Name FROM Books

WHERE Year =

(SELECT Year FROM Books

WHERE Book_Id =100);

--

its succeed ...

why the first not?

please help or give me any advice....

thanks in advance

Use the following query...

SELECT Book_Name FROM Books Join

(SELECT Year,Faculty FROM Books

WHERE Book_Id =100) D on Books.Year = D.Year and Books.Faculty = D.Faculty

|||

that great ..... thanks you.

but what I can do if I want to use "not in" instead of "=":

the new query will be:

--

SELECT Book_Name FROM Books
WHERE (Year,Faculty) not in
(SELECT Year,Faculty FROM Books
WHERE Book_Id =100);

-

|||

use the following query..

SELECT Book_Name FROM Books Left Outer Join

(SELECT Year,Faculty FROM Books

WHERE Book_Id =100) D on Books.Year = D.Year and Books.Faculty = D.Faculty

Where D.Year is NULL or D.Faculty is NULL

-or

SELECT Book_Name FROM Books Where Cast(Year as varchar) + '-' + Cast(Faculty as varchar) NOT IN

(SELECT Cast(Year as varchar) + '-' + Cast(Faculty as varchar) FROM Books

WHERE Book_Id =100)

|||

thank you a lot.

Worked for me

PLZ HELP: number of calls at a time

I have a traffic table which contains the following field:

START_DATE_TIME (e.g. 2/14/2006 7:19:54 AM)

and I want to the following;

    how many calls we have every minute (count) starting from 00:00 to 23:59?

    what's the maximam number of calls and what time was it?

-- Create tets table

create table #trafic(

id int identity not null primary key,

start datetime

)

go

--Insert sample data

insert into #trafic values(getdate())

insert into #trafic values(getdate())

insert into #trafic values(dateadd(hour, 1, getdate()))

insert into #trafic values(dateadd(hour, 2, getdate()))

insert into #trafic values(dateadd(hour, 3, getdate()))

insert into #trafic values(dateadd(minute, 10, getdate()))

insert into #trafic values(dateadd(minute, 10, getdate()))

--Show my sample date

select * from #trafic

--Result

id start

-- --

1 2007-03-06 11:14:28.983

2 2007-03-06 11:14:29.000

3 2007-03-06 12:14:29.000

4 2007-03-06 13:14:29.000

5 2007-03-06 14:14:29.000

6 2007-03-06 11:24:29.000

7 2007-03-06 11:24:29.000

--Calls per minute

select count(id)

, cast(datepart(hour,start) as varchar(2))+':'+cast( datepart(minute,start) as varchar(2)) --Expression for getting hour:minute part of call datetime

from #trafic

group by cast(datepart(hour,start) as varchar(2))+':'+cast( datepart(minute,start) as varchar(2))

--Result

-- --

2 11:14

2 11:24

1 12:14

1 13:14

1 14:14

(5 row(s) affected)

--Show max calls

select top 1 count(id)

, cast(datepart(hour,start) as varchar(2))+':'+cast( datepart(minute,start) as varchar(2))

from #trafic

group by cast(datepart(hour,start) as varchar(2))+':'+cast( datepart(minute,start) as varchar(2))

order by count(id) desc

--Results

-- --

2 11:24

(1 row(s) affected)

--If few minutes have maximuns call number

select top 1 with ties count(id)

, cast(datepart(hour,start) as varchar(2))+':'+cast( datepart(minute,start) as varchar(2))

from #trafic

group by cast(datepart(hour,start) as varchar(2))+':'+cast( datepart(minute,start) as varchar(2))

order by count(id) desc

--Result

-- --

2 11:14

2 11:24

(2 row(s) affected)

PLZ HELP: error while installing SQL Server Express!!

I am gettierror whle installing the SQL Server Express.

Product: Microsoft SQL Server 2005 Express Edition -- Error 29513. SQL Server Setup Failed to compile the Managed Object Format (MOF) file c:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof. To proceed, see "Troubleshooting an Installation of SQL Server 2005" or "How to: View SQL Server 2005 Setup Log Files" in SQL Server 2005 Setup Help documentation.

Typically this is an issue with WMI. Can you take a look at this thread and see if it applies to your situation?

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=124864&SiteID=1

Thanks,
Sam Lester (MSFT)

Plz Help!

Hi guys
I have installed SQL 7.0 for the first time and now when I try to
connect in query analyzer I get the following error message:

Unable to connect to server \\localhost:

server:Msg17,level16,state1
[microsoft][odbc sql server driver][dbnet lib]sql server does not exist

or access denied

I have already enabled the TCP/IP
I am using windows XP service pack 2
Thanx a lot in advance for ur kind help
regards
Mr NoviceMrNovice (akhil.gupta04@.gmail.com) writes:
> I have installed SQL 7.0 for the first time and now when I try to
> connect in query analyzer I get the following error message:
> Unable to connect to server \\localhost:
>
> server:Msg17,level16,state1
> [microsoft][odbc sql server driver][dbnet lib]sql server does not exist
> or access denied
>
> I have already enabled the TCP/IP
> I am using windows XP service pack 2
> Thanx a lot in advance for ur kind help
> regards

What did you specify in Query Analyzer for server? "\\localhost"? That's
not a magic name. Try . (a single dot) or "(local)".

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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspxsql

Plz help me! I want to use SQL Server2000 DTS Import/Export Wi

I'd still suggest using either a bulk insert or bcp. After your last
explanation, maybe bcp would be better. It'll definitely be faster than
inserting a row at a time. First of all, you can do massive inserts without
logging which will reduce overhead and speed the process. Second, you can
write your C# code to change the bcp command line, for example, change the
table name or the test file path/name according to whatever parameters you
want. In your program, write the bcp command to a windows .bat file then
execute a shell to run the bat if that makes more sense. That way you have
the flexibility to change the insert parameters on the fly and you get the
speed of bcp inserts.
Other than performing an import from text to sql table, what do you mean by
this statement?
"i want to get the functionality of DTS from C#. i mean i want
to use SQL Server objects and libraries to perform SQL server related
tasks from my application."
"Adnan" wrote:

> thanks for sparing time for me.
> actually i have log files that are very huge sized like 700MB or even
> sometimes these reach upto GBs.
> i want to extract information from these files u can say i want to
> apply filters to get only required rows. log files are maintained by
> IIS and contain space seperated fields in each row and there are
> millions of rows.
> now currently i m reading file line by line and inserting that line
> into a database table. after that i select data from that table using
> different filtering criteria and then binding that selected data to a
> data grid.
> now the problem is when i use huge sized files the process becomes very
> slow and user hav to wait for a long time so that the file to be read
> line by line and get inserted into database line by line.
> there are different sample codes that are related to execute DTS
> packages. i want to get the functionality of DTS from C#. i mean i want
> to use SQL Server objects and libraries to perform SQL server related
> tasks from my application.
> i hope that now u hav understood the scenario. the other thing is if i
> create a DTS package from sql server and while executing it i want to
> change its attributes like file name at run time so that i give file
> name as a parameter and the package with that file name get executed.
> if u still hav confusions abt understanding scenario then plz do tell
> me.
> thanks.
> best regards.
>BCP is very much like "bulk copy" technically, but BCP is a dos command. Yo
u
can read all about it in the Sql Server Books Online.
What I'm suggesting is that you can write your C# code to dynamically create
or edit a BCP command in a .bat file (technically it's just a text file).
You can manipulate the file/folder name or even the sql server table name
that the BCP will load if that makes sense in your application. You can set
it to load a table from a formatted or delimited file. For example, you sai
d
you have a space separated file.
bcp is pretty easy to set up and runs quickly.
A simple example of a bcp command would look like this:
bcp "database1.dbo.tbl_target_table" in "c:\foldername\file1.txt"
-c /S"servername" /U"userid" /P"userpassword" -f"c:\foldername\formatfile.fm
t"
In this example, the process is to load an existing sql table
(tbl_target_table) from a text file (file1.txt) using a format file that you
pre-created (formatfile.fmt)
There are many options for BCP depending on your needs. You would be
interested in the -t (field terminator character) and the -r (row terminator
character) which is where you'd tell it that a space is a field terminator
and a Cr/LF is the row terminator. As long as you can run a dos command fro
m
within C#, you can do this. BCP is part of Sql Server, not .Net per se, so
I
don't think you'll have any problems with your version.
"Adnan" wrote:

> hy
> thanks again :-)
> r u talking about SqlBulkCopy? is it BCP? as far as i know about
> it(SqlBulkCopy), it is supported in version 2 of Dot net and in my
> company we r using version 1.1. so if BCP is SqlBulkCopy then it is not
> possible now. and if this is other thing then i m going to check it and
> plz i'll b very thankful to u if u provide me related web links or
> material along with ur valuable suggestions.
> as far as my statement is concerned actually i was going to use SQLDMO
> and finding solution via SQLDMO. at present i hav to only import txt
> files but in future may b i need it.
> i m really thankful to u that u spared ur time for me because i have
> posted this problem at different forums but u r the only ho replied.
> my email id is "adnan.developer@.gmail.com" if u like to attach some
> useful material.
> best regards.
>|||Adnan,
Sorry, I can't help you with C# code. I don't use it. But I've done
similar processes from VB. I suggest you try a different MS community for C
#
programming help. Ask about opening a Dos command shell from c#. I'm sure
you can do this, and it's probably not very difficult.
Microsoft's sites will mostly just describe the command and options, as you
found. They will not help much if you are looking for specific code. But,
there are some good IT community sites other than Microsoft that offer tips
and code for just about any languange. You can search for them on the web
probably find something useful quickly. Use your favorite search engine and
find "C# programming examples" Here's one I like to use: www.ittoolbox.com
You need to know two main programming concepts: 1 how to create/update a
text file from within c#. 2: how to open a dos command shell and execute a
.bat or .cmd command file.
To use it, your application must know how to set up the BCP. that is, your
app must know the pathname/file name of the the text data file an of the BCP
.bat file. That's up to you to determine. Next, you would need to write a
BCP command to the .bat file using the the path/file name of the data, and
the SQL server, database, table, etc. that will be loaded. Last, you need t
o
open a dos command shell, and tell it to execute the BCP .bat file. All of
this can be done in the application without the user intervention if that's
what you need to do.
Good luck.
"Adnan" wrote:

> hello
> how r u tthrone?
> i hav read ur suggestion and i think it is v close to my solution but
> one thing that i hav to telll u that i m not an expert of .net i m new
> to it.
> as i found abt BCp it is a command line utility as u also told. now the
> problem is that from where i can execute it? i mean i m going to make a
> GUI windows based application and i m confudsed that how to implement
> it in my windows based application. plz help me regarding:
> if BCP is a command line utility then fromn which command prompt i can
> execute it? .net command prompt or which.
> and how and where i hav to use it in my application. i dont want my
> user to go to any command prompt.
> actually as it looks i m not clear about BCP that how it works and how
> it is used.
> i'll b very very thankful to u if u help me in this regard because i
> have already taken very much time from company for this.
> plz if it is possible then do provide me some sort of code or at least
> try to clear the concept that what steps should b taken to use BCP from
> my C# application.
> or if u know the link of such a web page then plz tell me because i hav
> searched my best but couldnt find satisfactory help. i hav already
> searched MSDN library it only tell about BCP but doesnt tell that how
> to use it in my application. it just tells its syntax and parameters
> details.
> best regards.
> Adnan Akram.
>

PLZ HELP ME WITH THE DECISION TREE!!

I'm having this problem.....

I wanted to use the Decision Tree to show a result..... after i configure the Mining Structures..... and set all the input.... my decision tree shows only until level 2..... i have 3 input and one PredictOnly column.....where is the other input?

Say.... i have House Owner, Marital Status, Num Cars Owned and Number Of Children(PredictOnly)

my Tree only shows All - > Marital Status when i input all 3 together...... the other 2 doesn't seems to show.

wat should i do? my database in SQL Server and the other keys are all correct and deploying finely.....why is this happening.....?

i'm a newbie in this software.......so any pro here can plz help me if there's actually something that i might have missed out along the way.......

Thank you again.........

It's likely that after the split on Marital Status, the other two inputs don't have enough information to cause the model to split any further. The inputs you provide are "suggestions" for the algorithms to look for information. If there is no information there, it won't find anything. Other algorithms, such as Naive Bayes, treat all inputs independently and simultaneously, so you may see even very small correlations. Decision Trees, however, needs to have a certain weight of evidence before it will decide to split.

plz help me to upload my sqlserver data base with query analyzer method

plz help me to upload my sqlserver data base with query analyzer method
plz write the code i should write in query analyzer box to uplode
my database(db) in my server(h_server)
and is it neccessary to uplode log file or not
,or guide me with intruducing a sitewhat xactly are you trying to do ? just load up query analyzer to test some queries ? its in the menu under microsoft sql server under your programs menu. or you can open it from tools - > query analyzer from sql server xplorer.

hth|||i understand what you ae saying but i dont know who i replace suitable elements in this code

CREATE DATABASE [co] ON (NAME = N'co_Data', FILENAME = N'e:\sqlserver 2000\MSSQL\data\co_Data.MDF' , SIZE = 1, FILEGROWTH = 10%) LOG ON (NAME = N'co_Log', FILENAME = N'e:\sqlserver 2000\MSSQL\data\co_Log.LDF' , SIZE = 1, FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO

exec sp_dboption N'co', N'autoclose', N'true'
GO

exec sp_dboption N'co', N'bulkcopy', N'false'
GO

exec sp_dboption N'co', N'trunc. log', N'true'
GO

exec sp_dboption N'co', N'torn page detection', N'true'
GO

exec sp_dboption N'co', N'read only', N'false'
GO

exec sp_dboption N'co', N'dbo use', N'false'
GO

exec sp_dboption N'co', N'single', N'false'
GO

exec sp_dboption N'co', N'autoshrink', N'true'
GO

exec sp_dboption N'co', N'ANSI null default', N'false'
GO

exec sp_dboption N'co', N'recursive triggers', N'false'
GO

exec sp_dboption N'co', N'ANSI nulls', N'false'
GO

exec sp_dboption N'co', N'concat null yields null', N'false'
GO

exec sp_dboption N'co', N'cursor close on commit', N'false'
GO

exec sp_dboption N'co', N'default to local cursor', N'false'
GO

exec sp_dboption N'co', N'quoted identifier', N'false'
GO

exec sp_dboption N'co', N'ANSI warnings', N'false'
GO

exec sp_dboption N'co', N'auto create statistics', N'true'
GO

exec sp_dboption N'co', N'auto update statistics', N'true'
GO

use [co]
GO

CREATE TABLE [dbo].[users] (
[u_id] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[u_username] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_password] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_joindate] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_email] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_prof] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_fname] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_lname] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_coname] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_location] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_city] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_nation] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_website] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[u_account] [float] NULL
) ON [PRIMARY]
GO

Tuesday, March 20, 2012

Plz help me SQL 2005 ( Attach database File .mdf )

when i try to attach file there is an error occur
" An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified) "
Plz help me i try all things
Enable remote connections on the instance of SQL Server that you want
to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL
Server and to the SQL Server Browser service
but still error occur
Plz help me
*** Sent via Developersdex http://www.codecomments.com ***
Are you able to connect to SQL Server Management studio and exeute simple
queries like SP_WHO and all?
If no; then verify the network connectivity from host to server.
Thanks
Hari
"hossam mohamed" <hosshoss2@.yahoo.com> wrote in message
news:umAN$vEBHHA.2140@.TK2MSFTNGP02.phx.gbl...
> when i try to attach file there is an error occur
> " An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005, this failure may be caused by the
> fact that under the default settings SQL Server does not allow remote
> connections. (provider: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified) "
>
> Plz help me i try all things
> . Enable remote connections on the instance of SQL Server that you want
> to connect to from a remote computer.
> . Turn on the SQL Server Browser service.
> . Configure the firewall to allow network traffic that is related to SQL
> Server and to the SQL Server Browser service
>
> but still error occur
> Plz help me
> *** Sent via Developersdex http://www.codecomments.com ***

Plz help me SQL 2005 ( Attach database File .mdf )

when i try to attach file there is an error occur
" An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified) "
Plz help me i try all things
Enable remote connections on the instance of SQL Server that you want
to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL
Server and to the SQL Server Browser service
but still error occur
Plz help me
*** Sent via Developersdex http://www.codecomments.com ***Are you able to connect to SQL Server Management studio and exeute simple
queries like SP_WHO and all?
If no; then verify the network connectivity from host to server.
Thanks
Hari
"hossam mohamed" <hosshoss2@.yahoo.com> wrote in message
news:umAN$vEBHHA.2140@.TK2MSFTNGP02.phx.gbl...
> when i try to attach file there is an error occur
> " An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005, this failure may be caused by the
> fact that under the default settings SQL Server does not allow remote
> connections. (provider: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified) "
>
> Plz help me i try all things
> . Enable remote connections on the instance of SQL Server that you want
> to connect to from a remote computer.
> . Turn on the SQL Server Browser service.
> . Configure the firewall to allow network traffic that is related to SQL
> Server and to the SQL Server Browser service
>
> but still error occur
> Plz help me
> *** Sent via Developersdex http://www.codecomments.com ***

Plz Help me out in this query

Declare @.i int
Select @.i=D_Places from MachineTests Where Test_Name='WBC_Count'
--Where D_Places is a user defined Number which defines the scale for
this Test
--While Converting it to Decimal

-- What does the following query do
-- I need to check the flag FORCE_HOLD_NDR if its 1 then
-- conversion is done on Result field of MachineResults Table

Select Case(FORCE_HOLD_NDR)
WHEN 1 THEN convert(DECIMAL(18,@.i), Result)
ELSE Result
END

Quote:

Originally Posted by

>From MachineResults


--Sounds really easy :) but its prompting me an Error
--"Server: Msg 170, Level 15, State 1, Line 5
--"Line 5: Incorrect syntax near '@.i'."

/*
So the problem i m facing is in supplying a variable (@.i in this case)
in Decimal constructor..

Is there any solution to remove this error however the bussiness
requiremt cant be
changed as the scale for the decimal is defined by the user in setup
file and it
can be anything ..

*/
Hope u guys Understand my question

Regards
Mohammad Rehan
Nortec Softwares Pvt LTDAm 17 Nov 2006 05:22:51 -0800 schrieb Roni:
...

Quote:

Originally Posted by

Select Case(FORCE_HOLD_NDR)
WHEN 1 THEN convert(DECIMAL(18,@.i), Result)
ELSE Result
END

Quote:

Originally Posted by

>>From MachineResults


>
--Sounds really easy :) but its prompting me an Error
--"Server: Msg 170, Level 15, State 1, Line 5
--"Line 5: Incorrect syntax near '@.i'."
>


This is not possible, you have to build a string and then execute this
string using EXECUTE or sp_executesql.
Here is an excellent article about it:
http://www.sommarskog.se/dynamic_sql.html
bye,
Helmut

plz help me out

we have set up merge rep and it is working fine. i have setup alerts if rep
fails.
recently i am not getting these alerts what would be the reason
how to configure alerts
Raghu,
please can you tell us which alerts are firing and any error messages
received from the merge agent.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||hai sir
right now i am not getting any kind of alerts and the message
is
the sql server agent mail session not running
"Paul Ibison" wrote:

> Raghu,
> please can you tell us which alerts are firing and any error messages
> received from the merge agent.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||Raghu,
have a look at these links for some more info on setting up mail/sql
integration:
http://support.microsoft.com/default...315886&sd=tech
http://support.microsoft.com/default...263556&sd=tech
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||hai paul sir
even though i read the articles i did not solved the error
plz tell me other way
"Paul Ibison" wrote:

> Raghu,
> have a look at these links for some more info on setting up mail/sql
> integration:
> http://support.microsoft.com/default...315886&sd=tech
> http://support.microsoft.com/default...263556&sd=tech
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||Raghu,
to be honest, for mail setup you're best off posting in the sqlserver.server
group. I'll chip in if there's no more specialized responses, but you're
likely to get more responses there.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Plz help me In reports

Hi,Im Designed a Webpage .It consosts of a Button, whenever i click onButton report must generated.When the report is in my system reportgenerated successfully.when I try to access a report from othersystem.I cudnot able to access report.Can any1 hlp me inthis aspect.any procedure in order to access the report of other system.wht shudbe url for Reportserverurl and reportpath

With regards,

mahender

mahender,

Have you tried

http://server/reportserver/reportdirectory/reportname.rdl

Take note that

- "reportserver"is a virtual directory named during the reporting services install, so your could be something different, the default from memory is reprotserver

- I am assuming you created the directory the report resides in some replace "reportdirectory"with this

- you can pass any parameters thru this method also

- this is url access into reporting services, you can also utlise the web services to access your reports

If this doesnt work check out what type of security the other system uses. What user is your web app connecting as and does this user have access

An error msg would also be helpful

plz help me how to give reportname in Reportexecutionservice

Hi

Im trying to load a report using

Reportexecutionservice

like this

Reportexecutionservice.ExecutionInfo exinfo=res.LoadReport(reportname, null);

rptname consists of report which is present @. my server.How to give reportname inorder to load a report .im using reportingservice2005

plz do help me.

error im getting Unable to indentify the report.Plz tell what is path i should given in order to acces th report..

It needs to be the path to the report, not just the name. So if your report named "MyReport" is in a folder named "Reports", then the path would be "/MyReport/Reports".

|||

Hai,

thnx for reply.Well all reports r present in Server.i mean We had created couple of Report using Businessintelligence studio .we try to deploy reports @. our server.So how to access those reports

With regards,

mahender

|||Browse to http://servername/reports. That will show you the Report Manager application which will let you navigate around and find the path to the published reports. From code, you can accomplish this using the ListChildren() method.|||HI,
Thnx for once again .Ha u said to search the path from reportmanager.I open my server as
(10.150.100.184:100/report) I saw my reports deployed how abt path there r actually stored .i need to give actuall we give reportpathname as "reportdirectory\reportname" similary for Report @. my server how can i access is it like"\\10.150.142.186\reportdirectory\reportname".Im i right

Plz do replyme...

With regards,
mahender

plz help me how to give reportname in Reportexecutionservice

Hi

Im trying to load a report using

Reportexecutionservice

like this

Reportexecutionservice.ExecutionInfo exinfo=res.LoadReport(reportname, null);

rptname consists of report which is present @. my server.How to give reportname inorder to load a report .im using reportingservice2005

plz do help me.

error im getting Unable to indentify the report.Plz tell what is path i should given in order to acces th report..

It needs to be the path to the report, not just the name. So if your report named "MyReport" is in a folder named "Reports", then the path would be "/MyReport/Reports".

|||

Hai,

thnx for reply.Well all reports r present in Server.i mean We had created couple of Report using Businessintelligence studio .we try to deploy reports @. our server.So how to access those reports

With regards,

mahender

|||Browse to http://servername/reports. That will show you the Report Manager application which will let you navigate around and find the path to the published reports. From code, you can accomplish this using the ListChildren() method.|||HI,
Thnx for once again .Ha u said to search the path from reportmanager.I open my server as
(10.150.100.184:100/report) I saw my reports deployed how abt path there r actually stored .i need to give actuall we give reportpathname as "reportdirectory\reportname" similary for Report @. my server how can i access is it like"\\10.150.142.186\reportdirectory\reportname".Im i right

Plz do replyme...

With regards,
mahender

plz help me

Hello every one ...

i m developing a website using asp.net and sql server .. & need to send email after registration and i know i need to configure Sql Mail ...

so plz tel me wht i needto do, to configure sql mail ... i m using sql server 2000 ..

OS: XP Pro with service pack 2

can i configure my mail client through Outlook 2003 or i need to have Ms Exchange server ...

plz guyz guide me step by step wht i need to do ...

Thanx for ur Cooperation
Kamran SorathiaHere is a link that might help:

http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci980136,00.html