An Interesting Idea...

Jun 23, 2007

Having no more experience than reading books online, here is an interesting idea I would like to run by you guys and you can let me know if it is feasible or tell me I need to put the crack pipe down...



We are going to increase the number of disks in our SAN, and I was speaking with the SAN administrator and he mentioned the shuffling of logical drives to match the new space. He said he is going to have to go through quite a few combinations/permutations on figuring out the best configuration for what data goes on the old vs. new to get the optimal space.



Is this something that can be modeled out? I can write something that recursively figures it out, but why not explore fun ideas with tools that may be able to do it?



Thank you in advance,

John Hennesey

View 3 Replies


ADVERTISEMENT

Very Interesting !

Jun 12, 2004

Below is the statement given in MicroSoft SQL Server migration documentation :

"When a view is defined with an outer join and is queried with a qualification on a column from the inner table of the outer join, the results from SQL Server and Oracle can differ. In most cases, Oracle views are easily translated into SQL Server views"

Please can anyone explain the above with some examples. I don't find such a 'CREATE VIEW' statement existsing in two DBs, which results in different result set. Am I wrong ?

Thanks,
Sam

View 2 Replies View Related

Interesting

Aug 26, 2004

Another tech was having the same problem with his sp which he also made into a macro. He was having the same problem as I was, he thought since he made the user the dbo owner that he woud have no problems...but since hes the one who created the db and the stored procedures when the user tried to access it he got that same error message. It went away after he went into the Enterprise manager and in the properties of the stored procedure under permission he gave the user EXEC permissions...And WAAALLLAAA problem solved :):):):)

View 10 Replies View Related

Interesting SQL...

Oct 22, 2004

Anyone else experience this? A developer just finished complaining about the performance of one of our databases. Well, he sent me the query and I couldn't understand why it was such a dog. Anyways I rewrote it. The execution plan is totally different between the two. I had no idea specifying the join made such a difference. First sql executed in 7 minutes that 2nd took 1 second. SELECT dbo.contract_co.producer_num_id, contract_co_statusFROM dbo.contract_co, dbo.v_contract_co_statusWHERE ( dbo.v_contract_co_status.contract_co_id = dbo.contract_co.contract_co_id ) AND contract_co_status = 'Pending' OR ( contract_co_status = 'Active' and effective_date > '1/1/2004' )SELECT dbo.contract_co.producer_num_id, contract_co_statusFROM dbo.contract_co INNER JOIN dbo.v_contract_co_status ON dbo.contract_co.contract_co_id = dbo.v_contract_co_status.contract_co_idWHERE contract_co_status = 'Pending' OR ( contract_co_status = 'Active' and effective_date > '1/1/2004' )

View 3 Replies View Related

Any Idea?

Mar 4, 2008

i have a table FORUM_REPLY it contain follwing fieldsquest_id,answer_id, reply_user_id.i want who is post most answer.so i need reply_user_id and max(no_of_answer).but following query given reply_user_id and no_of_answer onlySELECT reply_user_id,count(answer_id) as no_of_answer FROM FORUM_REPLY  GROUP BY(reply_user_id)How to get max_no_of_answer? 

View 13 Replies View Related

Can A DTS Do This For Me , If So, Any Idea How?

May 21, 2001

Hi all,

I am new to the DTS game - or at least to trying to do anything other than transfer rows between databases with identical structures.

I now need to create a far more complex DTS package to transfer data between an SQL Server database (I am using SQL Server 7.0) and an Oracle database. I have no trouble in making the connections and performing simple DTS's beween the two.

However, my current task is more complicated.

Problem 1:
In one database I would store fifty values as 5 five records each containing 10 values (i.e. has ten fields). However, in the other database these fifty values would all be stored as one record (i.e. one row with 50 fields). How could I go about creating a DTS to transfer this information?

Problem 2:
These values should only be transfered if certain conditions are met in an another unrelated table. For example, a flag in another table indicating that transfer of the said values should occur.

Any help with either of these problems would be much appraciated.

Thanks in advance,
Ross

View 3 Replies View Related

Any Idea's On 605

Nov 16, 2000

When one of the users log into the database via a thrid party application
they receive an error message:

2000/11/16 10:40:13.84spid51Error : 605, Severity: 21, State: 1
2000/11/16 10:40:13.84spid51Attempt to fetch logical page 7832 in database 'highview' belongs to object '1241055457', not to object 'application_data'.
2000/11/16 10:45:07.68spid46Getpage: bstat=0x1008/0, sstat=0x80002110, disk
2000/11/16 10:45:07.68spid46pageno is/should be:objid is/should be:
2000/11/16 10:45:07.68spid460x1e98(7832)0x49f900e1(1241055457)
2000/11/16 10:45:07.68spid460x1e98(7832)0x4810b86f(1209055343)
2000/11/16 10:45:07.68spid46... extent objid 0, mask 0/0, next/prev=0/0
2000/11/16 10:45:07.68spid46... retry bufget after purging bp 0x2da7e060


I tried running DBCC checkdb, newalloc,& checktable to fix the probelm and than droping the table and rebuilding it but not success, any suggestion are
more than welcome.

View 1 Replies View Related

Need An Idea How To....

Jun 21, 2002

If anybody can suggest the most efficient way to "page" the output from a big and wide table (about 7000000 records) in order to display on the web in the user requested sort order. Sort order could be on at least 7 different columns from 50 of returned.

I need to find a solution to move to the next and previous page.

Any Idea?

Dim

View 2 Replies View Related

Just An Idea

Jul 23, 2004

what if I took this trigger and based it on a view rather then a table

CREATE TRIGGER TerminationUpdateTrigger ON EmployeeGamingLicense
FOR UPDATE
AS
INSERT INTO TERMINATION(Status,[TM #],LastName, FirstName, [SocialSecurityNumber], DateHired, Title)
SELECT STATUS, [TM#], LASTNAME, FIRSTNAME, [SSN#], HIREDATE, JOBTITLE
FROM Inserted
WHERE STATUS = 'TERMINATED'


CREATE VIEW dbo.Update_Terminations
AS
SELECT STATUS, TM#, LASTNAME, FIRSTNAME, SSN#, HIREDATE,
JOBTITLE
FROM dbo.EmployeeGamingLicense
WHERE (STATUS = N'TERMINATED')

Base the Trigger on this View rather then on the Table itself????

View 2 Replies View Related

Some Idea

Apr 27, 2008

Hi I'm new to sql and it would be great if someone could give some idea on how to do the following

This is the relational model:

Department(DeptNum, Descrip, Instname, DeptName, State, Postcode)
Academic(AcNum, DeptNum, FamName, GiveName, Initials, Title)
Paper(PaNum, Title)
Author(PaNum, AcNum)
Field(FieldNum, ID, Title)
Interest(FieldNum, AcNum, Descrip)



The question is :-
Which academics have the largest number of fields of interests? Return their academic number,
given name, family name, institution and total number of fields they are interested in. Your must use a
subquery in the sense that you must use 2 sql statements and use any of the following to connect both:-


1)Exists
2)Not exists
3)IN

View 5 Replies View Related

Someone Have Any Idea About It?

Sep 18, 2006

I have a table call CLIENTE and another table call ENDERECO where the CLIENTE table has the FOREIGN KEY of the ENDERECO table.

When I try INSERT COMMAND in C# this message is show.

The instruction INSERT conflicted with a constraint of FOREIGN FUNDAMENTAL "FK_CLIENTE_ENDERECO." The conflict happened in the database "E:ARQUIVOS DE PROGRAMASMICROSOFT SQL SERVERMSSQL.1MSSQLDATALINETEC.MDF", table "dbo.I ADDRESS", column 'IDENDERECO.'
The instruction was concluded.

I am a "little" lost.

Thanks.

View 3 Replies View Related

Do Anyone Have An Idea?

Mar 21, 2007

Hi there,



I have number of tasks in my control flow most of them are execute sql task. I want to update one of the column in my table when anyone of the task in the control get fails?

Please let me know if anyone have an idea how to do this.



Thanks and Regards





View 3 Replies View Related

Interesting ID Issues...

Feb 1, 2007

Hi all,

I have a system in place currently that both a  local and a live database, currently the sales database is kept in line with a home grown "syncronise" script that controls keeping the two tables (live and local) in sync with the use of Local and Remote ID'sFor example;Table "Sales"ID - IntRemoteID - IntVarious Data fieldsThe 'Live' System writes new records using the RemoteID field, whilst the local inserts new records using the ID field. The Sync script copies the data up/down and assigns the corresponding RemoteID/ID's to the records as they are copied accordingly.Its been decided that this process must change, in favor of Two Way Replication. I have been tasked with finding the solution to the safe handling of ID's as theres a danger that two people can be writing a record (one live, one local) and possibly create the same ID's - i know that replication has its own ID's and could probably manage this well on its own, but these 'Internal' ID's have to be unique due to business rules.So i have been considering two possibilities to address this problem,1. Staggering the ID's - for instance Live ID's begin at 1,000,001 and local ID's begin at 1.2. Having a controlling ID table which provides the next IDBoth options have their advantages and disadvantages, with option 1 we will run into a problem later when the local ID's reach the 1 million mark (a few years away, i admit) and option 2 will need careful locking/transactional code to ensure the same ID isnt given twice.Does anyone have experience with this kind of issue? or could suggest an alternative approach to this problem?  Thanks in advance! 

View 2 Replies View Related

An Interesting Problem

Jan 3, 2001

We've had an interesting server issue here since about the start of the year, where the dual processor Netfinity server we've been running SQL 7 on has been holding steady at almost exactly 50% CPU utilization, give or take about 5%-10%. Disk utilization in all areas is relatively low. In fact, the server will do this right after a fresh reboot, with no users accessing. The really interesting part is that a graph of the two processors mirror each other. When the utilization of one goes up, the other goes down, almost perfectly. The two processors are the same speed, but their firmware build is different. IBM says it's not a problem. What say ye?

View 1 Replies View Related

Interesting Question!

Nov 28, 2001

If Query1 gives 1 row output as:

customer_id
1234
-------------------
Query2 gives 1 row output as:

product_id
8970
-------------------
How do we get the above results as a single result set of 2 columns side by side? as follows:

customer_id product_id
1234 8970


Is that possible in a single select statement??
Query1 and Query2 both are select statements on the same table with different where clauses.

Sheila.

View 2 Replies View Related

Interesting Problem

Jul 14, 1999

Hi ! I am facing an interesting problem for one of my databases. When I double click on a particular table in Enterprise Manager, the Manage Tables window shows me only one or two fields from the table. (it does not show me all the fields). When I run sp_help <tablename> in isql, all the information is displayed. Why is there such inconsistency. It happens only on one particular database. I have run DBCC commands but still no help. Does anyone have any ideas on this. Thankx,

View 3 Replies View Related

Interesting Challenge

Jul 12, 2005

We're having to work with some legacy data. The tables in the so-called database seem to have way more nulls than actual data. One table appears to have around 100 or more columns in it. It has close to 40,000 rows.

This Db has pretty much 0 normalization present.

IOW, your worst nightmare.

Is there a way we could run a query that would return the total number cells inthat contain NULL and another that could return the total number of data-bearing cells so we could come up with a % or a ratio.

View 9 Replies View Related

Folks ! Very Interesting !

Jun 8, 2004

Hi Folks,

This is a create table statement in DB2 z/ODS and OS/390 ( mainframe versions ) :

create table test(sno int) IN DATABASE database1 AUDIT NONE DATA CAPTURE NONE

This will create a table in the named database 'database1'.

1) In SQL Server, is there any equivalent for this 'IN DATABASE' syntax in DB2 ?

2) 'Data capture none' will not store any extra info about the data replication in the log files. Is there any eqiuivalent for this in SQL Server ?


Thanks,
Sam

View 1 Replies View Related

Interesting Error

Jan 10, 2008

In this SQL query I get en error like this:Incorrect syntax near ','.SELECT SUM(mCount * mPrice), CONVERT(DATEPART(yyyy, mDate), varchar) + '.' + CONVERT(DATEPART(mm, mDate), varchar) AS DateSoldFROM salesWHERE mDate BETWEEN '9/10/2007 0:0:0' AND '1/10/2008 23:59:59'I think you it isnt necessary to show values in the table because it is a syntax error but I dont undertand how it can be incorrect...Thanks for help...Saren Taşçıyan

View 14 Replies View Related

Interesting Problem

Jul 23, 2005

Imagine a table in Microsoft Sql Server 2000 named Pictures with threefields. A primary key ID(int), a Name(nvarchar) and a Picture(image)field.Lets put some records into the table. The first two fields as expectedwould take an int and a string. The third field is of type image.Instead of putting a bitmap in this field lets place an xml documentthat has been streamed into a byte array. The xml document woulddescribe the Picture using say lines. If the picture was that of asquare we would have four lines in the xml document. You could think ofthe xml document as something similar to vector graphics but thedetails are not relevant. The important fact is that the contents ofthe image field is NOT a bitmap but a binary stream of an xml document.Now imagine we have a reporting tool like Crystal Reports that can beused to report on this database table. Imagine we create a report byusing the three fields mentioned above. As far as Crystal is concernedthe first field is an int, the second a string and the third an image.If our table had ten records and we preview the report we like to see10 entries each consisting of an ID, Name and a Picture.This can only happen if the image field contains a Bitmap, but asmentioned above the field contains an xml document.Now my question...Can we write something in SQL Server 2000 (not 2005) to sit between thetable and Crystal Reports so to convert the XML document to a bitmap.The restriction is that we cannot use anything but sql server itself.The client in the above case has been Crystal Reports but it could beanything.I know SQL Server 2005 supports C# with access to the .NET frameworkwithin the database. Unfortunately, I am not using SQL server 2005.Some people have suggested the use of User Defined Functions and TSQL.I like to know from the more experienced SQL Server people if what I amtrying to achieve is possible. Maybe it has not been done but is itpossible?Any suggestions would be greatly appreciated...Many Regards

View 5 Replies View Related

Really Interesting Issue!

Sep 20, 2007



Hi All,

When I wanted to see ONLY today€™s records on the sql server, it took 5 minutes.
When I wanted to see records including today€™s records on the sql server, no problem. (19 Sep. is a past date which is working properly)
It is very interesting it takes 5 minutes to sort the lastday there is nothing wrong with the other days.
I ran DBCC INDEXDEFRAG method but no change anything.

I am wondering about something, everyday at 22:00 pm we are getting backup. Is this process creating a difference between before getting the back up and after got the backups?
It is really interesting issue. I do not know what I can say. It seems there is an issue with today€™s records. May be there are some locks on the today€™s records. I do not know. Why does not cause any issue for old dates but for current day ?



SELECT DISTINCT CallIDChar, ANI, DNIS, CallerName, AgentName, CallQueue, AgentID, CallType, CallStartTimeStamp, CallEndTimeStamp, CallDuration
FROM (SELECT MAINTBL.*, DRTTABLE.CallDuration AS CallDuration



FROM CallInfo AS MAINTBL

JOIN ( SELECT CallID, DateDiff(second, min(CallStartTimeStamp), max(CallEndTimeStamp)) as CallDuration


FROM CallInfo

GROUP BY CallID
) AS DRTTABLE ON MAINTBL.CallID=DRTTABLE.CallID
) as CallInfo

WHERE CallIDChar = CallIDChar


AND (CallStartTimeStamp >= '2007-09-20T00:00:00')

AND (CallStartTimeStamp <= '2007-09-20T23:59:59')

What can be reason for this issue and how can I solve it ?

Thank you in advance,

Melih

View 15 Replies View Related

An Interesting Bug For SSIS

Apr 12, 2007

I have a very simple SSIS package that imports data from ODBC source. There are two "Time" columns in source, but When this table is created in SQL2005, it give me "bigint"!!!



How can this happen?



I tried to import data to SQL2000, those two columns are created as "smalldatetime" properply.



Thanks.

View 11 Replies View Related

Interesting Challenge..

Aug 2, 2007

I am making a report in Visual Studio..Now my question is,is there anyway that i can add a tab control for my rdl??Hope to here from anyone out there with a know how..Thanks guys!!

View 13 Replies View Related

When Are Transactions A Bad Idea?

Mar 3, 2004

Lets say I have to insert 60,000 or so records into SQL Server from another data source using the sqlTransaction class.

However if at any point an error should occur I would like to roll back any changes.

Would a transaction be a bad idea when dealing with this many records?

Thanks for any advice.

SA

View 6 Replies View Related

Designing Idea Please

Mar 8, 2007

Dear Friends,I'm a junior DBA,
I've to prepare an online examination.
for this, I've three categories.
a)beginer level
b)intermediate level
c)expert level

again here subjects are 6. like sqlserver,oracle,c#,vb.net,html,javascript.
in these subjects, i've to select these three types of questions.
now how can i design for this requirement? shall i create three tables for beginer, intermediate,expert or shall i create 6 tables and write according that?

am i given correct inputs?

please give me an idea to design

thank you verymuch experts.


Vinod

View 2 Replies View Related

Need Good Idea

Jul 23, 2005

Hi guysWe have a following problem. For security reasons in each table in ourDB we have addition field which is calculated as hash value of allcolumns in particular row.Every time when some field in particular row is changed we create andcall select query from our application to obtain all fields for thisrow and then re-calculate and update the hash value again.Obviously such approach is very ineffective, the alternative is tocreate trigger on update event and then execute stored procedure whichwill re-calculate and update the hash value. The problem with thisapproach is that end user could then change the date in the tables andthen run this store procedure to adjust hash value.We are looking for some solution that could speed up the hash valueupdating without allowing authorized user to do itThanks in advance,Leon

View 6 Replies View Related

Any Idea What This Means .....?

Nov 7, 2007



Hi,

Does anyone have any idea waht this means:

aspnet_wp!resourceutilities!5!07/11/2007-10:32:00:: i INFO: Reporting Services starting SKU: Developer
aspnet_wp!resourceutilities!5!07/11/2007-10:32:00:: i INFO: Evaluation copy: 0 days left

It is take from the ReportServer log file.

Thanks in advance for any response.

Jon

View 1 Replies View Related

Need Idea About COLLATE

Sep 12, 2007

I need help regarding what is a collate and where to use.If any examples with INNER JOIN it could be more helpful....

View 13 Replies View Related

Interesting SQL Injection Reported

May 26, 2008

All of you just read this article
http://www.bloombit.com/Articles/2008/05/ASCII-Encoded-Binary-String-Automated-SQL-Injection.aspx

View 1 Replies View Related

Interesting SQLProblem Using Joins

Sep 1, 2004

Using Join when 2 columns in one table point to 1 column in another table

I have spent hours on this problem and no research has turned in my favour. Does anyone have any examples they can put forward for me.

I am really desperate to sort this out, and any help will be greatly appreciated.

Thanks
Shaun

View 1 Replies View Related

About SmallDateTime Sthg. Interesting

May 25, 2006

Hello,
In the code  SqlParameter dtDate = new SqlParameter("@date",SqlDbType.SmallDateTime,4);
dtDate.Value=Convert.ToDateTime(Session["date"].ToString());
cmd.Parameters.Add(dtDate);where the @date parameter is defined as a SMALLDATETIME inside a stored procedure, I cannot use a function such as "Convert.ToSmallDateTime" and it seems a conversion from DateTime to SmallDateTime takes place anywhere within the code. Eventually it works but I wonder if everything's ok with this code. Is there anything wrong about it?  Thanks

View 2 Replies View Related

Interesting Grouping Question

Jan 23, 2002

I have an interesting request.
I would like to take a table such as:

date value
----- -----
1/1/01 10.5
1/2/01 9.3
1/3/01 11.5
1/4/01 4.7
1/5/01 3.2

and calculate an average for each record, based on its own value AND the following two values. In other words, for the first record, I would take
sum(10.5 + 9.3 + 11.5)/3 and put this into a third column in my table. I would then do the same for the next record: sum(9.3 + 11.5 + 4.7)/3.
Thanks in advance!

BV

Does anyone know how to do this in SQl.

View 2 Replies View Related

Interesting Peculiarity (another Anomaly?)

Dec 8, 2004

Run the following: declare @s1 varchar(10), @s2 varchar(10) declare @t table( recordid int identity(1,1)not null,field char(1)not null) insert @t (field) select 'a' union select 'b'select @s1 = '', @s2 = ''select @s1 = @s1 + field +',' from @t order by 1select @s2 = @s2 + field +','from @t order by recordidselect[Weird]=substring(@s1, 1,(datalength(@s1)-1)),[Not]=substring(@s2, 1,(datalength(@s2)-1))

View 2 Replies View Related







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