Need A Solution ... Urgently

May 26, 2004

These two queries when executed seperately give results in under 10 secs

A union between these two does not give results even after 20 minutes ...

Any idea why this is happening


SELECT
T001W.NAME1,
t25a5.bezek SKU,
QTY = SUM(CASE MSEG.BWART
WHEN '101' THEN MSEG.ERFMG
WHEN '102' THEN (-1)*MSEG.ERFMG END),
YPLNT.VKGRP
FROM MARA ,MSEG, MKPF,YPLNT,T001W,t25a5
WHERE
MSEG.MANDT = MKPF.MANDT
AND MKPF.MANDT = MARA.MANDT
and mkpf.mandt =yplnt.mandt
and mkpf.mandt = t25a5.mandt
AND MKPF.MBLNR = MSEG.MBLNR
AND MARA.MATNR = MSEG.MATNR
AND YPLNT.PPLNT= MSEG.WERKS
AND MSEG.WERKS = T001W.WERKS
and t25a5.ww004 = SUBSTRING(MARA.PRDHA, 10, 3)
AND MARA.PRDHA <> ''
AND MKPF.VGART IN ('WR','WF')
AND MKPF.MJAHR=YEAR(@BUDAT1)
AND MSEG.AUFNR IS NOT NULL
AND MSEG.BWART IN ('101','102')
GROUP BY t25a5.bezek,T001W.NAME1,YPLNT.VKGRP

SELECT
T001W.NAME1,
t25a2.bezek SKU,
QTY = SUM(CASE MSEG.BWART
WHEN '101' THEN MSEG.ERFMG
WHEN '102' THEN (-1)*MSEG.ERFMG END),
YPLNT.VKGRP

FROM MARA ,MSEG, MKPF,YPLNT,T001W,t25a2
WHERE
MSEG.MANDT = MKPF.MANDT
AND MKPF.MANDT = MARA.MANDT
and mkpf.mandt =yplnt.mandt
and mkpf.mandt = t25a2.mandt
AND MKPF.MBLNR = MSEG.MBLNR
AND MARA.MATNR = MSEG.MATNR
AND YPLNT.PPLNT=MSEG.WERKS
AND MSEG.WERKS = T001W.WERKS
and t25a2.ww001 = SUBSTRING(MARA.PRDHA, 1, 3)
AND MARA.PRDHA <> ''
AND MKPF.MJAHR=YEAR(@BUDAT1)
AND MKPF.VGART IN ('WR','WF')
AND MSEG.AUFNR IS NOT NULL
AND MSEG.BWART IN ('101','102')
GROUP BY t25a2.bezek,T001W.NAME1,YPLNT.VKGRP

View 14 Replies


ADVERTISEMENT

SQL Server Equivalent To Access UCASE And TRIM (was Solution Needed Urgently!!!)

Feb 23, 2005

Please provide me with this queries solution


"select leadsource_id from Leadsource_Master where trim(ucase(leadsource_name))='" & Address_Module.name_check(Trim(UCase(cmbLeadSource ))) & "'"

It is a query in access, I want to use the same in SQL SERVER 2000 using VB 6.0

View 14 Replies View Related

SOLUTION! - VB.NET 2005 Express And SQL Server 2005 - NOT Saving Updates To DB - SOLUTION!

Nov 30, 2006

VB.NET 2005 Express and SQL Server 2005 Express - NOT saving updates to DB - SOLUTION!

-----------------------------------

The following article is bogus and confusing:

How to: Manage Local Data Files - Setting 'Copy to Output Directory' to 'Do not copy'
http://msdn2.microsoft.com/en-us/library/ms246989.aspx

You must manually copy the database file to the output directory
AFTER setting 'Copy to Output Directory' to 'Do not copy'.

Do not copy








The file is never copied or overwritten by the project system. Because your application creates a dynamic connection string that points to the database file in the output directory, this setting only works for local database files when you manually copy the file yourself.

You must manually copy the database file to the output directory
AFTER setting 'Copy to Output Directory' to 'Do not copy'.

-----------------------------------

The above article is bogus and confusing.

This is rediculous!

This is the most vague and convoluted bunch of nonsince I've ever come accross!

Getting caught out on this issue for the 10th time!
And not being able to find an exact step-by-step solution.

--------------------------

I've tried it and it doesn't work for me.

Please don't try what the article eludes to as I'm still sorting out exactly what is supposed to be happening.



If you have a step-by-step procedure that can be reproduced this properly please PM me.

I would like to test its validity then update this exact post as a solution rather than just another dicussion thread.

Many thanks.



This is the exact procedure I have come up with:

NOTE 1: DO NOT allow VB.net to copy the database into its folders/directorys.

NOTE 2: DO NOT hand copy the database to a folder/directory in your project.

Yes, I know its hard not to do it because you want your project nice and tidy.
I just simply could NOT get it to work.
You should NOT have myData.mdf listed in the Solution Explorer. Ever.

Create a folder for your data following NOTE 2.

Copy your data to that folder. * mine was C:mydatamyData.mdf



Create a NEW project.

Remove any Data Connections. ( no matter what)

Save it.

Data | View Data Sources

Add New Data Source

select NEW CONNECTION ( No Matter what, do it!

Select the database. * again mine was C:mydatamyData.mdf

Answer NO to the question:
Would you like to copy the file to your project and modify the connection?
- NO ( no matter what - ANSWER NO ! - Absolutely NO )
Then select the tables you want in the DataSet.
and Finish.



To Test ----------

From the Solution Explorer | click the table name drop down arrow | select details
Now Drag the table name onto the form.

The form is then populated with a Navigation control
and matching Labels with corresponding Textboxes for each field in the table.

Save it.

1) Run the app.

Add one database record to the database by pressing the Add(+) icon

Just add some quick junk data that you don't mind getting lost if it doesn't save.

YOU MUST CLICK THE SAVE ICON to save the data you just entered.

Now exit the application.

2) Run the app again.

And verify there is one record already there.

Now add a second database record to the database by pressing the Add (+) icon.

NOW add some quick junk data that you WILL intentionally loose.

*** DO NOT *** press the save icon.

Just Exit the app.

3) Again, Run the app.

Verify that the first record is still there.

Verify that the Second record is NOT there.
Its NOT there because you didn't save the data before exiting the app.

Proving that YOU MUST CLICK THE SAVE ICON to save the data you just entered.

Also proving you must add your own code to catch the changes
and ask the user to save the data before exitiing or moving to another record.

As a side note, since vb.net uses detached datasets,
(a copy/snapshot of the dataset in memory and NOT directly linked to the database)
the dataset will reflect all changes made when moving around the detached datasets.
YOU MUT REMEMBER TO SUBMIT YOUR CHANGES TO THE DATABASE TO SAVE THEM.
Otherwise, they will simply be discarded without notice.

Whewh!

I hope this saves me some time the next time I want to start a new database project.

Oh, and uh, for anyone else reading this post.

Thanks,
Barry G. Sumpter

Currently working with:
Visual Basic 2005 Express
SQL Server 2005 Express

Developing Windows Forms with
101 Samples for Visual Basic 2005
using the DataGridView thru code
and every development wizard I can find within vb.net
unless otherwise individually stated within a thread.

View 17 Replies View Related

Newby, Very Very New To ASP But I Need Urgently

Feb 25, 2008

to create a code.
Hi everyone,
I have SQL SERVER 2005 on my desktop and i need to run queries from remote machines on my SQL SERVER.
I thought it would be a good i idea to create a web page on my machine to where remote users can contact and activate SQL QUERIES.
My question is very simple and i wonder i a simple answer is available:
How do i run SQL queries whereby ASP code ?
How do i make a connection between a web page (.asp code) and a SQL sever ?
If the answer is complicated as i'm afraid it is, could any one provide me a link for a tutorial dealing with the above issues ?
Thanks a lot !
 

View 2 Replies View Related

I Need An SQL Server DBA Urgently

May 11, 2000

Hello, I have an urgent need for a DBA who knows SQL server 6.5 and 7 very well. Also if you have any ASP experience this would be music to my ears. Please give me a call to find out more 02 9221 6601 Australia.

View 2 Replies View Related

Hello Everyone, Urgently Need Help Related To UDF

Jul 24, 2007

I have a function written in postgresql that I want to create in sql server (UDF). After effort of full day I am seding this request to please help me, here is the function:

CREATE OR REPLACE FUNCTION fn_comma_env(int4)
RETURNS text AS
$BODY$
DECLARE
rec record;
str text;
comstr text;
BEGIN
str := '';
comstr := '';
FOR rec IN SELECT class.classname FROM hostenv, class WHERE hostenv.classid = class.classid AND (hostenv.hostid = $1) LOOP
str := str || comstr || rec.classname;
comstr := ',';
END LOOP;
RETURN str;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

Thanks in advance,
Syed

View 1 Replies View Related

Need Answers Urgently Please

Aug 8, 2007

Hello Friends,
1) I have a table and column names are
Executiveid
companyname
positiontitle
start date
enddate
I want to see all executives who worked for more than 1000 days in one job. I am not sure but may be i need to use datediff function.

i have 3 tables and i have to use joins
table 1 executive
executiveid
firstname
lastname
companyid

table2 company
companyid
companyname
sales
currencycode

table3 currency
currencycode
description

how am i supposed to join 3 tables. i know how to give joins on 2 tables.

Your help will be greatly appreciated. Thanks

View 2 Replies View Related

Urgently Help Needed

Feb 14, 2008



hi all ,
i am working on a migration project of database from access 2003 to sql server 2000 but facing a problem in converting queries from access to sql server , is there any way or tool through which i can convert the queries to sql server format
Thanks in advance

Diwakar

View 1 Replies View Related

Hello Everyone, Urgently Need Help Related To UDF

Jul 25, 2007

I have a function written in postgresql that I want to create in sql server (UDF). After effort of full day I am seding this request to please help me, here is the function:

CREATE OR REPLACE FUNCTION fn_comma_env(int4)
RETURNS text AS
$BODY$
DECLARE
rec record;
str text;
comstr text;
BEGIN
str := '';
comstr := '';
FOR rec IN SELECT class.classname FROM hostenv, class WHERE hostenv.classid = class.classid AND (hostenv.hostid = $1) LOOP
str := str || comstr || rec.classname;
comstr := ',';
END LOOP;
RETURN str;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

Thanks in advance,
Syed

View 1 Replies View Related

Basic Sql Help Required Urgently

Apr 28, 2008

i have created my sql mdf file
now i was tring to create sql script for the same how do i do that?
script to create databse and tables
in object explorer i right clicked on my databse file name
 
selecdted tasks and then generate script
after that i clicked on next button
 
now how do i proceed further?
 
 

View 3 Replies View Related

Timeout Problem - Urgently Need Help!

Oct 26, 2005

Hi, My site (in VB.NET) has developed a intermediate timeout problem.
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Can someone tell me what could cause this intermediate problem. Is it something wrong with the query? It is definitely the problem from the query as I have 2 queries using same design and both of them develop similar problem.
Pleaee help as our site will have major advertising next month so need to fix it by then.
My server is running Win2003 on SQL 2000.
I have shown the cut-down version of the original query:
***************************************************************CREATE PROCEDURE dbo.sp_getmyitems(@CurrentPage tinyint,@PageSize int,@TotalRecords int OUTPUT)AsSet NoCount ON
Declare @FirstRec intDeclare @LastRec intSet @FirstRec = (@CurrentPage - 1) * @PageSizeSet @LastRec = (@CurrentPage * @PageSize + 1)
Create Table #TempTable(LocalItemID int IDENTITY PRIMARY KEY,ItemID int,Title varchar(250),)
Insert Into #TempTable(ItemID,Title)SELECT ItemID, TitleFROM tbl_Items
Select ItemID,TitleFrom #TempTableWhere LocalItemID > @FirstRec AND LocalItemID < @LastRec
Select @TotalRecords = Count(*) FROM #TempTableGO
**************************************************************Thank you
 

View 3 Replies View Related

Urgently Need Help From SQL Server Gurus

Aug 17, 2000

4 days ago we had a Server crash luckily we have the daily full database backups...Since the server which was crashed is unusable I installed SQL 7.0 on another machine...I tried to restore databases from our backup tapes...Here is the T-SQL I am running:

restore database pentatel from tape='.ape0' with file=2,move 'PentaTel_dat' TO 'D:mssql7datapentatel.mdf', move 'pentatel_log' to 'D:mssql7datapentatel.ldf'

The error message I am getting is:

Processed 8992 pages for database 'pentatel', file 'PentaTel_dat' on file 2.
Processed 1 pages for database 'pentatel', file 'PentaTel_log' on file 2.
Server: Msg 9004, Level 21, State 1, Line 1
The log for database 'pentatel' is corrupt.

Connection Broken

After these when I look at the SQL Enterprise manager I see that the database is in loading status...I left it in that status for hours but there was no reaction...So I tried to detach and attach a single file.Here are the TSQLs and Error messages...


exec sp_attach_single_file_db pentatel, 'd:mssql7datapentatel.mdf'

Server: Msg 945, Level 14, State 2, Line 1
Database 'pentatel' cannot be opened because some of the files could not be activated.
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'pentatel'. CREATE DATABASE is aborted.

We have 7 backups and I tried all of them...Same error messages...

When I try to change the status from loading to emergency or normal the database is always inaccessible

I are running these statements

exec sp_configure 'allow',1
reconfigure with override
update sysdatabases set status=32768 where db_id=6

and I stop and start the Mssql7 service but still inaccessible

Any idea???

I despretaly need help...Any recomendation is greatly apreciated...

Sefa Sevtekin

View 4 Replies View Related

Help Reqd Urgently (SQL Query)

Oct 15, 2004

Pls consider the following table:---


Table Name: ChemoAdmin

Fields:

Field Name: Field Type: Typical Value:

patientID (Varchar 10) XYZABC001
stationDate (DateTime) 09/17/2004
drugName (Varchar 25) Drug 1
dose (Numeric) 5
doseUnit (Varchar 5) mg


I require the following output using one query:---


DATE 09/17/2004 09/21/2004

Drug 1 5 mg Nil
Drug 2 2 mg 4 mg
Drug 3 Nil 1 mg



Pls help.

View 1 Replies View Related

Help Reqd Urgently (SQL Query)

Oct 15, 2004

Pls consider the following table:---


Table Name: ChemoAdmin

Fields:

Field Name: Field Type: Typical Value:

patientID (Varchar 10) XYZABC001
stationDate (DateTime) 09/17/2004
drugName (Varchar 25) Drug 1
dose (Numeric) 5
doseUnit (Varchar 5) mg


I require the following output using one query:---


DATE 09/17/2004 09/21/2004

Drug 1 5 mg Nil
Drug 2 2 mg 4 mg
Drug 3 Nil 1 mg


Pls help.

View 11 Replies View Related

Urgently Need The Query Optimization

Apr 11, 2008

hi guys

i have a query which will take lot of load on the sql server and it need to optimized.

can any one suggest in optimizing the below query.


SELECT TOP 1 p.store_purchase_id

FROM valid_purchase p WITH (NOLOCK)

INNER JOIN purchase_item pitm WITH (NOLOCK)

ON p.purchase_id = pitm.purchase_id

INNER JOIN customer_phone c WITH (NOLOCK)

ON p.customer_brand_id = c.customer_brand_id

INNER JOIN phone ph WITH (NOLOCK)

ON c.phone_id = ph.phone_id

WHERE

p.last_name = ''

AND pitm.item_datetime > CURRENT_TIMESTAMP

AND pitm.item_datetime <= DATEADD(d, 12, CURRENT_TIMESTAMP)

AND REPLACE(ph.number, '-', '' ) = ''



Thanks
Ramakanth

View 5 Replies View Related

Paging In SQL2000,help Needed Urgently

Feb 8, 2007

 Hi,I urgently need help with this. I am trying to implement custom paging with Sql 2000. However I have ran into a few problems.I really hope that someone would be able to help me out. I need to get this done by tomorrow!! (I know I screwed up big time, but I didn;t relize that built in paging fetches all the records, and the displays it page by page!!) 1) Currently the paging seems to be working. However the primary key always resets itself. For example, lets say I have 4 records ID 1,2,3,4When I delete ID 3, instead of displaying ID 1,2,4 it shows ID 1,2,3. Is there any way to solve this problem?2) The database that I am currently creating will have about 40,000 records, is it advisible for me to use your control (I hope so)?Thank you and do have a nice day.http://www.codeproject.com/aspnet/ASPNETPagerControl.asp    CREATE PROCEDURE [dbo].[GetPagedProducts11]
(
@PageSize int,
@CurrentPage int,
@ItemCount int output
)
AS
Declare @UpperBand int, @LowerBand int

-- Get The Count Of The Rows That They Meet the Criteria
SET @ItemCount = (SELECT COUNT(*) FROM aduan)

-- Calculate the @LowerCount and @UpperCount
SET @LowerBand = (@CurrentPage - 1) * @PageSize
SET @UpperBand = (@CurrentPage * @PageSize) + 1

-- create a temporaty table
CREATE TABLE #AllRows(
ad_id int PRIMARY KEY IDENTITY(1, 1),
ad_nama varchar(40),ad_tarikh datetime , ad_status varchar(30) ,ad_title varchar(100)
)

-- INSERT ALL THE Rows that meets the Criteria
INSERT INTO #AllRows
SELECT ad_nama,ad_tarikh, ad_status,ad_title
FROM aduan


-- AND finally select and return desired -Paged- Rows
SELECT ad_id, ad_nama, ad_tarikh, ad_status,ad_title
FROM #AllRows
WHERE ad_id > @LowerBand AND ad_id < @UpperBand


RETURN 

View 3 Replies View Related

Help Required Urgently(SQL Server Agent)

Oct 15, 2004

On one of our servers the sqlseragent was running fine. But now it is not running. We se the option to start the server agent each time the OS starts. Even when I tried to start the agent manually from service manager it is not starting. Would any one help on this urgently.

Also how can we identify under what account any job runs. The reason is when we deleted some NT user accounts one of the job failed as this job runs under that userid. But in the properties it shows that sa is the owner of that job. What is best way to create a job so that these jobs run under one userid so that it won't fail when we delete users.

Thanks

View 4 Replies View Related

Equivalent In Oracle, Needed Urgently

Sep 20, 2006

CREATE TABLE [omx].[UserAuthorization]( [MemberAuthorizationRecordIdentifier] [varchar](50) NOT NULL, CONSTRAINT [PK_UserAuthorization] PRIMARY KEY CLUSTERED( [MemberAuthorizationRecordIdentifier] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]

View 4 Replies View Related

Urgently , DTS Import Data Fail

Mar 4, 2004

My DTS package for importing data from oversea's database fail becasue it use many time ( more 2 hours ) . It will be complete When the run duration was used less than 2 hours and fail when the run duration was used more than 2 hours . If we eleminate to improve network , there is any way to do ?


Thanks you

View 2 Replies View Related

SSAS 2005 SQL Query Urgently Help !!

Aug 13, 2007

Hi, I'm building a SSAS Integration project, it consist of extracting data from a Microsoft Access 2003 database and consolidate data into a SQL Server 2005 database for datawarehousing.
I need to make several operations for integration, but i'm struck in the following:

- I added an Ole DB Origin that connects to my access database
- I made an sql query with multiple joins that extract all data i need for first instance.
- in data i extracted, i got one column named: FECHA (and many other colums), it contains data of the date of the actual sale; but in previous steps i fill a table named DimTiempo from my sql server database that contanins all the dates (with no repeating) of the sales and added an unique primary key for them; so, now i need to get that primary key for each column FECHA i gotted in my sql query in OLEDB ORIGIN, for example:



I have: 20/20/2004 (column FECHA on my OLEDB ORIGIN gotted with an sql query with multiple joins)
I need: 001 (extracted from DimTiempo, its the primary key of the registry 001 - 20/20/2004)

I need that code or primary key to insert into my new table on my sql server database because its related directly with my DimTiempo table filled previously.

For more directions, i don't have that primary key column on the original access data base; i reestructure completely the database on sql server to make the datawarehouse work fine.


Please, i hope you help me, tell me what do i need to do to get all the data to fill my sql server 2005 database.

Thanks.

View 4 Replies View Related

SQL Query Code Correction Require Urgently

May 25, 2008

Hi All,First of all its very very urgent. Secondly I am not an expert. Now here is my problem.I want to loop through my html files and want to save the data in my table column. here is the Code which need correction.CODE:USE [AdventureWorks]DECLARE @cmd varchar(1000);DECLARE @FileName varchar(100);DECLARE @FilePath varchar(100);SET @FileName = 'C: est'+@FilePath+'html';SET @cmd = 'INSERT INTO myTable(FileName, FileType, Document)' +     'SELECT ' +  @FilePath + ', FileType,     * FROM OPENROWSET(BULK @FileName, SINGLE_CLOB) AS Document'EXEC (@cmd);Select * from myTableJust for practice I am using Adventureworks db. I am using SQL Express 2005.My html files are named something like this:AC0234.htmlDB9803.htmlCG4571.htmlI cannot change my file names.Thanks in advance.Regards; 

View 1 Replies View Related

How To Avoid Record Inconsistency .....Help Urgently Needed

Mar 7, 2004

hi Friends...
I have got a ordermaster table in which the orderid field is autoincremental.Now I also have an Ordercode field which is a combination of [current (orderid)-LICON)]
eg 1-LICON ..
I achieve this using the following query ...
insert into ordermaster(ordercode,orderamt,orderdate) select cast(max(orderid)+1 as varchar)+'-LICON' as ordercode,1000,'3/6/2004' from ordermaster

But I think the above query could lead to an inconsistent state ....If say following occurs :

1) USER1 reads max orderid as 1
2) User2 also reads max orderid as 1
3)USER 1 inserts record with ordercode as 2-LICON.
4)USER 2 will also insert record for ordercode as 2-LICON since max orderid read by USER2 is also the same as USER1.

How do I avoid this....I know I there are LOcktypes. But aren't locktypes used when we are updating same records....

Please help me out .I really need help in ths context

View 2 Replies View Related

FlatFile Parsing Problem - Urgently Need Assistance!

Mar 6, 2006

We have a BIG problem that has been occurring for quite sometime. We have a RAGGED-RIGHT FFS (FlatFileSource) component which receives a FF and then transforms to XML. We define 10 FIELDS with the last field as {CRLF} per ragged right style. Simple right? The source file is sent to us from multiple separate groups, some of which don€™t use the last two fields and have early line termination, so they basically are not there. The problem is that when we define X amount of fields in SSIS, it expects X amount of fields to be there. So when we receive the source file that doesn€™t contain last two fields, SSIS tries to read in the next line, and in most cases successfully places the fields from the next line into the missing fields. Now what we end up with is a source file with 10 rows, but only half successfully transformed, with every other row fitted into the last two XML fields. SSIS completely ignores the {CRLF} until those specific numbers of spaces/fields have been met €“ even if it has to go onto the next line to get them. This seems horribly wrong to me. I would think that at the very least there should be some type of validation that prevents it from grabbing the next line. I thought that is what fixed-length SSIS style is for, and ragged right for allowing to parse multiple rows. We could enforce all clients to produce X char spaces (and we do), but there can be cases in any aspect where a file could get accidentally sent over with a shortened row. I have heard from certain individuals that SSIS adapter wasn€™t designed with this in mind. Is this true, I am to believe that this would still get parsed without throwing any errors and potentially damage the ERP system it is going into? If this is the case then I feel extremely disheartened about SSIS €“ especially with all of the great advancements it has made.
 
We desperately need a workaround or at the very least some way to validate that a new row {CRLF} isn€™t getting picked up in the first row of the flat file connection. Please can someone help ASAP!?

View 8 Replies View Related

Help Needed Urgently! - SQL7 Replication Conflict Problem

Dec 18, 2001

Hi all,

i think i have serious problem. i have almost 20,000 rows with the following conflict on a table (generated by merge replication over a period of around 3 weeks) :

'The row was updated at 'SubscriberServer3.DatabaseA' but could not be updated 'at 'PublicationServer1.DatabaseA'. Metadata mismatch'

i have 20 remote subscribers & 1 publisher. The above message originates from practically everywhere.

Besides dropping(not practical at the moment) & recreating replication to get rid of them, what else can i do to resolve this problem?? Do i have to resolve this problem row by row?? i'm at my wit's end. Please help!!

Thanx in advance.

View 2 Replies View Related

HELP - SQL Server 2000 Install Files Needed Urgently

Jul 23, 2005

Hi!I have a large project that is due to complete this week. In order tocomplete it I need SQL Server 2000 installed on a remote server. Mydisk is corrupt and to order another media disk would damage mydeadline. I have the licence and serial key, but now need good installfiles. I am even ready to buy another retail box, if I can find asupplier that would give me a download site for the media, while I waitfor the shipment!Please PLEASE help!Regards,Barry

View 6 Replies View Related

How To Upload A MS Word Textfile Onto A SQL Server Dbase, Please Help! Urgently Needed!

Dec 27, 2006

Hello there guyz!ahm, i just want to ask, how can i upload a MS word text file to a SQL Dbase? I know i must use the Input File, the one in the Toolbox menu for HTML controls. but i need to know 1. How can i link the SQL dbase to the Input file Button? 2.  How to put the MS word file onto the SQL dbase? 3. what should i use to declare the MS Word file on the SQL Dbase? is it variable? char? etc... THank you so much! Please i Really need this one to put up my thesis system. and if it isn't much of a task, please can anyone  send me  the  SOURCE CODES  for my  questions?  

View 9 Replies View Related

Best Solution

Dec 3, 2003

Let say I have a table that is composed of 11 columns - one the Primary Key and the other are keys to rows in another table. Of these 10 column 2-10 are nullable. Can I get all the info in one SELECT? I can't use JOINS because columns 1-10 are keys to the same table. I am not very good at explaining these things but hopefully it makes sense.

Thanks

View 5 Replies View Related

Need A Solution

Oct 3, 2001

Using SQL 7 (of course), is there a way to give a user access to create and modify Stored procedures without actually giving them DBO rights?

View 1 Replies View Related

Best Possible Solution

Jan 11, 2005

Hi folks, guidance required!
Clients have an MSDE installed and they need all of their data to be dowloaded for the first time from our website. 30 tables r involved.
Can i automate this? I suspect BCP allows only one table to be exported into a text file. Since it's the first time process i don't want to setup replication.



Howdy!

View 2 Replies View Related

Just A Solution

Sep 27, 2007

Hello All,
I have a transaction table that holds nearly a million records and my master with 60000 records,I want to fetch details based on two dates.

I use Union operator to query the info from a view,is this right or fetch the result into a temporary table and fetch the result from temporary table using the same Union operator.

Which is the better way to fetch details faster.

Nirene

My SP is pasted below just advice me to execute this more efficiently,cos this SP is called thru a Web application.

CREATE PROCEDURE GL @SDt Varchar(10),@EDt Varchar(10),@Loccode Char(5),@OP Char(4)
AS

Declare @OpBalQry NVarchar(1000),@TrnQry NVarchar(2000),@MainSQry NVarchar(500),@MainEQry NVarchar(500)
Declare @Cocode Char(5)
Declare @CashGL Char(6),@Gldesc Varchar(50)

IF EXISTS (Select 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='#Gltmp')
Begin
Drop Table #Gltmp
End

Select @Cocode=Cocode from Location Where Loccode=@Loccode
Select @CashGL=Glcode,@Gldesc=Gldesc from Glmast Where Cocode=@Cocode and Subgroupcode='CASH'

Set @OpBalQry='Select A.Glcode,'''' as Trtype,''' + @SDt + ''' as Refdt,'' Opening Balance'' as Refno,
Max(B.Gldesc) as Narration,Case When (Sum(A.Deb)-Sum(A.Cre))<0 Then (-1*(Sum(A.Deb)-Sum(A.Cre))) Else 0 End as Dr,
Case When (Sum(A.Deb)-Sum(A.Cre))>=0 Then (Sum(A.Deb)-Sum(A.Cre)) Else 0 End as Cr from
(
Select Glcode,
(Case When Drcrflag=''D'' Then Opbal Else 0 End) as Deb,
(Case When Drcrflag=''C'' Then Opbal Else 0 End) as Cre from Obdata
Union
Select Glcode,
(Case When Drcrflag=''D'' Then Tramt Else 0 End) as Deb,
(Case When Drcrflag=''C'' Then Tramt Else 0 End) as Cre from Trans_Journal
Where Refdt <Convert(Datetime,''' + @SDt + ''',103)
) A,Glmast B Where B.Cocode=''' + @Cocode + ''' and A.Glcode=B.Glcode Group By A.Glcode
Union
'
Set @TrnQry='SELECT T.Glcode,T.Trtype,Convert(Varchar,Max(T.Refdt),103) as Refdt , '''' AS Refno,
(Rtrim(Ltrim(Max(G.Gldesc))) + '' -- From Sub-Ledger'') AS Narration,
SUM(CASE WHEN T.Drcrflag = ''D'' THEN T.tramt ELSE 0 END) AS Dr,
SUM(CASE WHEN T.Drcrflag = ''C'' THEN T.tramt ELSE 0 END) AS Cr
FROM Trans_Journal T,Glmast G
WHERE T.Glcode=G.Glcode and G.Cocode=''' + @Cocode + ''' and (T.Slcode IS NOT NULL AND Len(Rtrim(Ltrim(T.Slcode)))>0) and
(T.Refdt>=Convert(Datetime,''' + @SDt + ''',103) and T.Refdt <=Convert(Datetime,''' + @EDt + ''',103)
and T.Loccode= ''' + @Loccode + ''' and (G.Subgroupcode<>''BANK'' or G.Subgroupcode<>''CASH''))
GROUP BY T.Glcode,T.Trtype
UNION
SELECT A.Glcode,'''' as Trtype,Convert(Varchar,A.Refdt,103) as Refdt, A.Refno, B.Gldesc AS Narration,
CASE WHEN A.Drcrflag = ''D'' THEN A.Tramt ELSE 0 END AS Dr,
CASE WHEN A.Drcrflag = ''C'' THEN A.Tramt ELSE 0 END AS Cr
FROM Trans_Journal, Glmast B
WHERE (A.Glcode = B.Glcode and B.Cocode=''' + @Cocode + ''') and
(A.Slcode IS NULL OR Len(Rtrim(Ltrim(A.Slcode)))=0) and
(A.Refdt>=Convert(Datetime,''' + @SDt + ''',103) and A.Refdt<=Convert(Datetime,''' + @EDt + ''',103))
and A.Loccode=''' + @Loccode + ''' and (B.Subgroupcode<>''BANK'' or B.Subgroupcode<>''CASH'')
Union
Select Glcode,Trtype,Convert(Varchar,Max(Refdt),103) as Refdt,'' '' as Refno,Max(Narration) as Narration,Sum(Dr) as Dr,Sum(Cr) as Cr from
(Select A.Glcode,A.Trtype,A.Refdt,B.Gldesc as Narration,
CASE WHEN A.Drcrflag =''D'' THEN A.Tramt ELSE 0 END AS Dr, CASE WHEN A.Drcrflag =''C'' THEN A.Tramt ELSE 0 END AS Cr
from Trans_Journal,Glmast B
WHERE
(A.Glcode=B.Glcode and B.Cocode=''' + @Cocode + ''' and A.Refdt>=Convert(Datetime,''' + @SDt + ''',103)
and A.Refdt<=Convert(Datetime,''' + @EDt + ''' ,103)
and A.Loccode=''' + @Loccode + ''') and (B.Subgroupcode=''BANK'' or B.Subgroupcode=''CASH'')
Union
Select ''' + @CashGL + ''' as Glcode,Trtype,Refdt,''' + @Gldesc + ''' as Narration,
CASE WHEN Drcrflag =''C'' THEN Tramt ELSE 0 END AS Dr, CASE WHEN Drcrflag =''D'' THEN Tramt ELSE 0 END AS Cr
from Trans_Transnarr
WHERE (Trtype=''CPM'' or Trtype=''CRT'') and Loccode=''' + @Loccode + ''' and
Refdt>=Convert(Datetime,''' + @SDt + ''' ,103) and Refdt<=Convert(Datetime,''' + @EDt + ''',103)) TT
Group By Glcode,Trtype) X'

Set @MainSQry='Select Glcode,Trtype,Refdt,Refno,Narration,Dr,Cr Into #Gltmp from ('

Declare @Fullqry NVarchar(4000)

If @OP='WOB'
Begin
Set @TrnQry = @OpBalQry+@TrnQry
End

Set @FullQry = @MainSQry+@TrnQry

Exec sp_executesql @FullQry

Select Glcode,Trtype,Refdt,Refno,Narration,Ltrim(Rtrim(Str(Dr,14,2))) as Dr,Ltrim(Rtrim(Str(Cr,14,2))) as Cr from #Gltmp SQL2XML
Where Dr+Cr<>0 Order By Glcode,Trtype,Refdt,Refno for XML AUTO

Drop Table #Gltmp
GO

View 3 Replies View Related

Better Solution

Mar 28, 2008

hi,

i want to get following output:
id_order | type | number
-------------------------
1234 | A | 1
1235 |A | 0
1235 |B | 0
1236 |B | 1
1237 |C | 0
1237 |D | 0


create table tbl_order
(
id_order int
,type nvarchar(40)
)

insert into tbl_order (id_order, type) values (1234, 'A' )
insert into tbl_order (id_order, type) values (1235, 'A' )
insert into tbl_order (id_order, type) values (1235, 'B' )
insert into tbl_order (id_order, type) values (1236, 'B' )
insert into tbl_order (id_order, type) values (1237, 'C' )
insert into tbl_order (id_order, type) values (1237, 'D' )
insert into tbl_order (id_order, type) values (1238, 'A' )
insert into tbl_order (id_order, type) values (1239, 'D' )
insert into tbl_order (id_order, type) values (1239, 'B' )
insert into tbl_order (id_order, type) values (1239, 'A' )


select
id_order
,type
--,isnull(orderX,'') as number
,case when orderX > 1 then 1 else 0 end as number2
from tbl_order
left join (select t2.id_order as orderX
from tbl_order as t2
where
(select count(t1.id_order)
from tbl_order as t1
where
t1.id_order = t2.id_order) = 1
)as x
on tbl_order.id_order = x.orderX


Is there any better/faster select sentance to do this? i'm using sql2000.

thank you

View 1 Replies View Related

Possible Solution?

Mar 3, 2008

Hi, i am not sure if i can solve the problem with SSIS. I wanted do do it hardcoded with C# or so.

So, for my project I need to download zip-files on a daily-base. In these zip-files are xml-Files. And in these files is information stored for inserting or updating tables on a MS-SQL-Server.

So, my question, is it possible to solve that with SSIS? And if, is it easy to understand and to learn within a few days?

I haven't found good sources for information on how to get the data out of XML-Files.

View 18 Replies View Related

Any Solution For That?

Jun 15, 2006

I've got a .dts which load data to several Sql2k servers by Copy SQL Server Objects Task. I'd like to add another task for a Sql25k but I can't because of it's requesting SMO.

It seems that such task need DMO. I know that there are other ways for do such stuff in that DTS but I wonder if there is any trick or shortcut for to avoid this barrier.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved