Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Tuesday, March 27, 2012

can not install MSDE

Hi
I have installed .net framework 1.1 and .net web matrix from 'sams teach yourself asp.net' CD. I installed MSDE from the same CD, its not giving any error, but at the end it does not promt to restart the computer, even after restarting I can not see the MSDE icon in the system tray, also I dont see MSDE in the add/remove programs in control panel.I installed sql2kdesksp3.exe from www.asp.net/msde/, but the same thing repeats.

1. Shld I install the sql2kasp3.exe(Analysis services companents) and sql2ksp3.exe(Databasre components) also?

I am new to asp,It will be helpful if somebody can tell me how to install MSDE.

ThanksHere are step-by-step instructions. Try going over them again in case the machine didn't install it properly:

http://www.asp.net/webmatrix/guidedtour/Appendices/installMsde.aspx|||Hii

I Installed MSDE via command line as given in tht site and there was no error but dint get tht MSDE icon in system tray.
I tried to install MSDE via batch file, there was no error, but when started the MSDE service, I couldnt see the "MSSQLSERVER", there is only MSSQLServiceASHelper, when clicked on it it gives the error as

"could not start the MSSQLServerADHelper service on Local Computer
eror2:The system cannot find the file specified"

Now wht shld I do??Can I download the missing file separately.I installed from the cd again and the same repeated.plzz tell me whtt I shld do now.
Thank You|||Yeah, follow the directions here to reinstall:
http://www.asp.net/msde/default.aspx?tabindex=0&tabid=1|||Hi
I tried by installing from tht site, to install it again it takes another 8 to 10hours as I use dialup connection.Cant I download the missing file separately?|||The files you point to are Service Pack 3 files for SQL Server 2000. You need this file to patch MSDE with SP3: Sql2kdesksp3.exe

Check out the SQL Server and MSDE Service Pack 3a update page:
http://www.microsoft.com/sql/downloads/2000/SP3.asp

You may be able to order on CD, or at least download the correct file.|||Thanks a lot for answering me, I am downloading it again from the given site, if the same problem repeates then I'll buy the Cd.
Does SQL server 2000 and MSDE work the same way?

Thank you.|||Pretty much. MSDE doesn't have all the high-end features that SQL Server has, nor does it have a graphical interface designer like Query Analyzer or Enterprise Manager.

Wednesday, March 7, 2012

Can I use sql:variable() to change insert type from 'into' to 'as first into' ?

Hi
I'm trying to dynamically affect how text is inserted into an xml
element. I'd like to be able to use the following:
-- ========================================
===== --
declare @.x xml
,@.insert int
,@.insertType varchar(20)
set @.x = N'
<webpage>
<createdate>Sep 6 2005 11:04AM</createdate>
<title>Themes</title>
<info>Here is</info>
</webpage>
';
set @.insert = 3;
set @.insertType =
case @.insert
when 1 then ' into '
when 2 then ' as first into '
when 3 then ' as last into '
when 4 then ' before '
when 5 then ' after '
end
SET @.x.modify('insert text {" some text."}
sql:variable("@.insertType")
(/webpage/info)[1]');
select @.x;
select 'Insert type: "'+@.insertType+'"';
-- ========================================
===== --
The above doesn't work since sql:variable("@.insertType") is not
evaluated to the string ' as last into ' when the query is executed.
I've been able to get it to work by creating a query string and
executing it with sp_executesql but for longish strings it turns into
an apostrophe-escaping nightmare and quickly becomes very difficult to
read and debug.
Does anyone have any ideas how I could get this to work?
ThanksXQuery (neither our implementation nor the standard) does not provide for a
dynamic evaluation expression. So the only way to achieve what you want, is
to use the SQL Server dynamic SQL evaluation using either EXEC or
sp_executesql.
E.g.,
declare @.x xml
,@.insert int
,@.insertType nvarchar(20)
,@.stmtstr nvarchar(max)
set @.x = N'
<webpage>
<createdate>Sep 6 2005 11:04AM</createdate>
<title>Themes</title>
<info>Here is</info>
</webpage>
';
set @.insert = 3;
set @.insertType =
case @.insert
when 1 then N' into '
when 2 then N' as first into '
when 3 then N' as last into '
when 4 then N' before '
when 5 then N' after '
end
set @.stmtstr = N'DECLARE @.x xml; set @.x = N'''
+ cast(@.x as nvarchar(max))
+ '''; SET @.x.modify(''insert text {" some text."}'
+ @.insertType
+ N'(/webpage/info)[1]''); select @.x';
select @.stmtstr;
exec sp_executesql @.stmtstr;
select 'Insert type: "'+@.insertType+'"';
Best regards
Michael
<firechaser@.talk21.com> wrote in message
news:1128331019.225989.284590@.g43g2000cwa.googlegroups.com...
> Hi
> I'm trying to dynamically affect how text is inserted into an xml
> element. I'd like to be able to use the following:
>
> -- ========================================
===== --
> declare @.x xml
> ,@.insert int
> ,@.insertType varchar(20)
> set @.x = N'
> <webpage>
> <createdate>Sep 6 2005 11:04AM</createdate>
> <title>Themes</title>
> <info>Here is</info>
> </webpage>
> ';
> set @.insert = 3;
> set @.insertType =
> case @.insert
> when 1 then ' into '
> when 2 then ' as first into '
> when 3 then ' as last into '
> when 4 then ' before '
> when 5 then ' after '
> end
> SET @.x.modify('insert text {" some text."}
> sql:variable("@.insertType")
> (/webpage/info)[1]');
> select @.x;
> select 'Insert type: "'+@.insertType+'"';
> -- ========================================
===== --
>
> The above doesn't work since sql:variable("@.insertType") is not
> evaluated to the string ' as last into ' when the query is executed.
> I've been able to get it to work by creating a query string and
> executing it with sp_executesql but for longish strings it turns into
> an apostrophe-escaping nightmare and quickly becomes very difficult to
> read and debug.
> Does anyone have any ideas how I could get this to work?
> Thanks
>|||Yes, I wasn't sure if dynamic evaluation was supported in sql server's
implementation of XQuery. Thanks for the confirmation - much
appreciated.

Saturday, February 25, 2012

Can I use Custom UI for executing Package in C#?

Hi

I've a doubt. I don't know whether it is possible or not.

I've a very less knowledge in DTS packages.

When I execute a package in C#. it is displaying predefined GUI for showing process.

Can I've my own UI when executing DTS.

Thanks in advance.

Could you clarify what you mean by "When I execute a package in C#" and whether the question is about DTS 2000 or SSIS. This forum is about SSIS, BTW.|||

Thanks for the reply Michael

I'm using SSIS

I'm putting the C# code here


public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Package package;
ConnectionManager ConMgr;

Package p;
private void Form1_Load(object sender, EventArgs e)
{
string pkg ="Package.dtsx";

Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();
p = app.LoadPackage(pkg, null);

}

private void button1_Click(object sender, EventArgs e)
{
if(p!=null)

p.Execute();

}
}

When I click on Button ie) p.Execute(); is invoked I need my own UI to see the processing . Is it possible.

Thank u

|||Of course - you need to implement event sink interface (IDTSEvents) and/or logging sink interface (IDTSLogging), and call package.Execute(...) version that takes these interfaces (pass null for all other arguments). You'll get the information about the package progress and can show the UI similar (or completely different if you choose) to the one DtExecUI shows (DtExecUI uses the same interfaces).|||

Thanks michael

It is useful

and can I know abt DtExecUI for what it is useful for?.]

|||Well, it executes the packages :)

Some people use command line and some people like to use GUI to execute packages. We provide DTEXEC and DTEXECUI for each group appropriately.|||

Thank u Michael .

Thanks for ur support to know these.

And finally one , can u provide some resource to learn , how to create custom UI. and executing package.etc

|||

Hi

I've one more doubt.

Executing package is a single threaded or multi threaded?

Can I catch the names of the currently transfering table when Executing package?

Thanks in advance.

|||Execution is multithreaded, you'll need to gather information you need from the event and pass it to the UI thread, and probably call package.Execute() on a different thread too to avoid locking up the UI.

There are many events and log information, see Books Online for details. Creative use of this information joined with the package information (e.g. transform properties) may give you most of the information you need.

I don't have any sample, sorry.|||

Thanks alot Michael.

Thursday, February 16, 2012

Can I rollback a delete?

Hi!
I made a wrong delete in my database.
Can I recover the data of that table??
The query was:
delete from table
I should write something like this
delete from table where column = 87
ThanksSure..

BEGIN TRAN

DELETE FROM myTable99

ROLLBACK TRAN

...you didn't create a transaction?

Time to restore the DB from a backup to a new db and copy the data from there...

No back up?

How about printed listings and start typing?|||No printed listings ...
Better think of some excuse fast.

Any way have heard of a third party tool that might help .. am not sure .. something called log explorer from lumigent. Havent tried it out yet.|||Thank you!...Im now searching the backup information...Now the question is if I can restore only that table?

How?

Thanks

JP
Originally posted by Enigma
No printed listings ...
Better think of some excuse fast.

Any way have heard of a third party tool that might help .. am not sure .. something called log explorer from lumigent. Havent tried it out yet.|||No,

You can only restore the whole database...

DON"T overlay the existsing one, create a new DB (use attach), and then copy back the lost data...|||Yep, I have just started to try out Lumigent Log Explorer and it sure can recover deletes and other changes from the log.

Haven't done anything more than some small trials on it yet, but it don't seem to hard to use.

http://www.lumigent.com/products/le_sql/le_sql.htm|||Restore on to a new db, bcp out the table you want and bcp in into the old db

You might wanna check for dependencies of the table ..|||What's the cost? Is there a free demo?

Heard about it..never had a need...|||Havent had the need to use the log explorer till now ... my backups work just fine ... and i just bcp out the entire database tables once a day to take care of such cases. Takes care of such cases where data is accidently deleted or updated very fast.

Sunday, February 12, 2012

Can I pass '=' or '>' as parameters?

Hi
I'm moving SQL in my app to Stored Procedures.

My SQL string is currently created within my app, and I have two check boxes and this C# code...

if(chkPartTime.Checked&&!chkFullTime.Checked) { sql+=" AND P0_Hours = 0"; }

if(!chkPartTime.Checked&&chkFullTime.Checked) { sql+=" AND P0_Hours > 0"; }

where sql is my query string

If both boxes are checked I don't care what value P0_Hours is, but at least one of them will be checked.

What I want to know is how I transfer such logic into a Stored Procedure, or whether I will need to creat 2 similar sp's and choose which to call in my app.

It will combined with a query (currently 60 lines) comprising of 3 UNIONs

TIA

Sure why not...

you could literally pass a char(1) of '>' or '=' and use it to build the sql string

However wouldn't it be better to pass 'bit' fields like this:

SP paremeters:

@.chkPartTime bit

@.chkFullTime bit

then in the code:

in the Where clause:

Code Snippet

and ((p0_hours = 0 and @.chkPartTime = 1 and @.chkFullTime = 0) or (p0Hours > 0 and @.chkFullTime = 1 and @.chkPartTime = 0))

or better yet... just have one parameter:

@.chkFullTime bit and then 0 = Parttime 1 = FullTime

so then the code would look like:

Code Snippet

and ((p0_hours = 0 and @.chkFullTime = 0) or (p0Hours > 0 and @.chkFullTime = 1))

-Robert

|||

use the flag parameter (new param) & pass the appropriate flag value to the sp.

for example on your code,

Code Snippet

int iFlag = 0;

if(chkPartTime.Checked && !chkFullTime.Checked) { iFlag = 1; }

if(!chkPartTime.Checked && chkFullTime.Checked) { iFlag = 2; }

//Pass this flag variable as parameter while calling the SP

on your SP,

Check the flag using IF condition are on where condition to get the required result.

Code Snippet

Select * From

(

Select .... From Table1

Union ALL

Select .... From Table2

Union ALL

Select .... From Table3

) as Data

Where

@.Flag = 0

Or

(@.Flag = 1 And P0_Hours =0)

Or

(@.Flag = 2 And P0_Hours >0)

--or

If @.Flag = 0

Select * From

(

Select .... From Table1

Union ALL

Select .... From Table2

Union ALL

Select .... From Table3

) as Data

If @.Flag = 1

Select * From

(

Select .... From Table1

Union ALL

Select .... From Table2

Union ALL

Select .... From Table3

) as Data

Where

P0_Hours =0

If @.Flag = 2

Select * From

(

Select .... From Table1

Union ALL

Select .... From Table2

Union ALL

Select .... From Table3

) as Data

Where

P0_Hours > 0

|||

I don't know, I usually would just suggest a dynamic SQL stored procedure in these cases, particularly if there is any real heft to your data. The other solutions suggested are a good possibilities too, but the complexities of coding tend to turn things like this into a nightmare both to maintain, and to get a decent query plan anyhow.

Louis

|||

Thank you all

It was difficult to choose which to mark as the answer!

I had not heard of dynamic sp's (I come from a DB2 background, now using SQL Server) and I have learnt from all 3 answers, still not made my mind up which way to go, but thanks.

Friday, February 10, 2012

Can I link the data mining Results to any front end or CRM system

Hi

I am using association alogorythm for market bsket and I want to publish this results to the CRM system or to any Front end application is it possible and if yes pl let us now how to go head with the same

Thanks In advance

Rajesh Ladda

In general the answer is yes - there are many ways to accomplish this.

You can use Integration Services to export query results, you can use DMX in code to perform predictions, you can use Reporting Services to create data mining reports in your applications as well.

There are many examples at www.sqlserverdatamining.com on how to use data mining in a variety of scenarios.