Selecting Colunm With A Space ''

May 22, 2006

When I submit a sql :

select * from view from column=''

the table is a view point to oracle table with ole db provider for oracle

In mssql2000, the result return rows which containing a space ' '

However, in mssql2005, the result return no rows .

Any advise on it?









View 6 Replies


ADVERTISEMENT

While Selecting Data From A Table, Disk Space Getting Abnormaly Low..

Feb 12, 2008

Hi All ..

I have 2 disk drive
C and D


The SQL Server data and log files are stored in D: drive

I have only 575 MB free spaces in C: drive

I have a Sql data base name StoresDB and there is a table name CustTBL

There are almost 6555500 rows in that table

My issues are whenever I am querying the CustTbl from Query Analyzer
(Select * from CustTbl)

The C: space decreased to 40 kb

And the same time,I am not getting all the rows in the query result
In Query analyzer Message Tab it is showing (6555151 row(s) affected)
But In the Grid Tab it is showing Grid#1 :6318847 rows or sometime less rows....

What is the reason to for these two issues?

I have updated the index and statistics for CustTbl TABLE but not got any changes
..
When I closed the query window the C: drive again showing 575 MB free space

View 8 Replies View Related

Want To Colunm

Mar 15, 2007

Afternoon all,

I have a colunm sName(nVarChar(255) which has first name and second name in it and is divended with a ",". Can somebody show me to put these in there own colunm sFirstName and sSecondName.

Very Kind regards.

View 1 Replies View Related

Updating Colunm

Mar 18, 2008



Hello



Can some body help me in performing this?

I want to move the data from Colunm Value to Colunm CPublicID whenever CCField = 'PublicID' as shown below in green color( Without using Cursor or While loops)


CPubID ------------CCTable ------------CCField------------ DWTable------------ DWField ------------Value
101 XYZ Type Dimension Flag Related
101 XYZ ClaimAssocType Dimension Key Related
101 XYZ ID Dimension Flag 1890
101 XYZ ID Dimension Key 1890
101 XYZ PublicID Dimension Flag 103
101 XYZ PublicID Dimension Key 103
101 XYZ PublicID Dimension Flag 230
101 XYZ PublicID Dimension Key 230
101 XYZ PublicID Dimension Flag 5691
101 XYZ PublicID Dimension Key 5691



CPubID ------------CCTable ------------CCField------------ DWTable------------ DWField ------------Value
101 XYZ Type Dimension Flag Related
101 XYZ ClaimAssocType Dimension Key Related
101 XYZ ID Dimension Flag 1890
101 XYZ ID Dimension Key 1890
103 XYZ PublicID Dimension Flag 103
103 XYZ PublicID Dimension Key 103
230 XYZ PublicID Dimension Flag 230
230 XYZ PublicID Dimension Key 230
5691 XYZ PublicID Dimension Flag 5691
5691 XYZ PublicID Dimension Key 5691



Also , I need to know the best practice to perform the below process. Which of them is advisable?



I have a table, say as above, which has lots of data, say 100,000 records. I need to look at each row and perform certain updates/ trasnformation to a colunm (Value). I aslo, need to hold the old colunm. I came up with two method

Process A) Clone the table. So I have table2 which is a copy of table1. Read the Table1, update / trasnfored the Table2

Table1 Colunm(Value) will have Old values and table 2 colunm(Value) will have transformed values

Process B) Clone the Colunm. So I have a colunm Value and its clone Value2. Read the table and value for Colunm Value and Update the Value2.



I am using process A. because I beleive , process B, reading and updating same table make sthe entire process slow.



Please advice on th ebest industrial practice of doing this.



Thanks in advance for all the help


View 5 Replies View Related

Deriving The Colunm

Nov 13, 2007



Hello All

I want to creat a colunm from two colunms in a specific format

COL1 COL2 COL3
123456 01-10-2007 12070001 ( 12: From First two digit of Col1, 07 from the year of colunm2 and 0001: if combination 1207 is first else increment)
125647 01-11-2005 12050001
126756 12-25-2007 12070002 (* here since combination of 1207 is repeating it gets increment to 0002)

Can somebody help me please

View 8 Replies View Related

Current Date As A Colunm

Jun 15, 2006

hi

i wanted to crete an extra colunm when i retrive a set of rows...
the date colunm must show the current date eg 15/06/2006

currently im writing it as follows

select cost, '15/06/2006' as CDate
from prices

as you can see this is static date i need the date to be current whenever the query is done.

View 4 Replies View Related

Update A String In A Colunm

Apr 25, 2007

Afternoon all.
I have a table which has a column with has been inserting incorrect data, here is an example. Column name is description and table name is tblClientUsage:
[companyname]: 288bsl | | 13/03/2007
[companyname]: 288asl | | 08/03/2007
[companyname]: RES04sl | | 19/02/2004
[companyname]: RES01sl | | 19/02/2004
[companyname]: AAsl | | 31/12/2005
[companyname]: 652Asl | | 05/02/2007
[companyname]: GAZ1sl | | 20/03/2007
[companyname]: AAsl | | 31/12/1999
[companyname]: 363asl | | 20/01/2007
[companyname]: 288b1sl | | 02/11/2006
[companyname]: 288bsl | | 02/11/2006
Now what has been happening is that is has not been putting the company name in the column, just the text companyname. Now i have a table which has the company name and company id, i can easily join the two tables together but how can i replace just the companyname text in the description column with leaving the text after.

Any help would be great

View 3 Replies View Related

Selecting The Most Recently Edited Item AND Selecting A Certain Type If Another Doesn't Exist

Sep 20, 2007

I've got a big problem that I'm trying to figure out:
I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those.

I don't need this for an individual ID select, I need it applied to every record from the table.

My address table has some columns that look like:
[AddressID] [int]
[LocationID] [int]

[Type] [nvarchar](10)
[Address] [varchar](50)
[City] [varchar](50)
[State] [char](2)
[Zip] [varchar](5)
[AddDate] [datetime]
[EditDate] [datetime]

AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table.
So there will be multiple addresses to one LocationID, but each address will have it's own AddressID.

How can I do this efficiently with perfomance in mind???

Thank you in advance for any and all replies...

View 2 Replies View Related

How To Replace Empty Space Or White Space In A String In A Stored Procedure

Nov 14, 2007

Hi,
 I am trying to do this:
UPDATE Users SET  uniqueurl = replaceAllEmptySpacesInUniqueURL('uniqueurl')
What would be the syntax.
Any help appreciated.
Thanks
 

View 1 Replies View Related

Mutilple Space Gets Converted To Single Space In Report Viewer Control

Feb 23, 2007

I am generating a Report from Sql Data Source in Sql Server 2005 and viewing the Report in Report viewer control of Visual Studio 2005.
The data in the Data Source contains string with multiple spaces (for example €œ Test String €œ) but when they get rendered in Report viewer control, multiple spaces gets converted to single space €? Test String €œ.

I tried following solutions
1) Replacing spaces with €œ €?
2) Inserting <pre> tag before the string and </pre> tag after the string (Also tried &lt;Pre&gt; instead of <pre>)

But in all the cases result is same. The Report Viewer control is showing €œ&nbsp€? instead of space and €œ<Pre>€? tag instead of preserving spaces.

Please provide me a solution so that spaces can be preserved in Report Viewer.

View 1 Replies View Related

Transact SQL :: How To Find Space Available Or Send Space Alerts In Percentage

Nov 26, 2015

I am using the below script to get space alerts  and now i am interested in sending alerts  if for any drive space available is Less than 10% or 15%.. how to convert beelow code to find in % 

Declare @Drives Varchar(20)
DECLARE @Spaces Varchar(50)
DECLARE @availableSpace FLOAT
DECLARE @alertMessage Varchar(4000)
DECLARE @RecipientsList  VARCHAR(4000);
CREATE TABLE #tbldiskSpace

[Code] ....

View 3 Replies View Related

Trans Log-&>space Allocated 27GB, Space Used 100MB

Mar 2, 2005

Hi.. I was doing a good maintenance on my DB and my trans log LDF keep growing until 30GB but my DB data file MDF is only 2GB. I found the two following method to reduce my log size.

Method 1: I used veritas to backup log file with truncate
Method 2: I used the shrink database option in Enterprises manager to shrink it (file chosen=log , use default option)

After doing that, I found my LDF log file is still about the same size=27GB but when I see clearly, from the shrink database windows, the log spaced used reduced to only 100MB, the allocation log space is still 27GB. Why? How to make the LDF smaller to be the around the same size as the space used 100MB?

View 1 Replies View Related

Double Space Replaced With Single Space By Dbms ??!

Jul 20, 2005

This is driving me bananas. Can't find any info on this anywhere....SQL 2000 seems to replace double space with a single space when I seta varchar field to " " (2spaces), it only stores " " (1space). Whyon earth would microsoft do this? If I save 2 spaces - I WANT TO SEE2 SPACES!!!!Can anyone help? Is this a database setting? Is this due to usingvarchar?Any help appreciated.Colin Hale

View 2 Replies View Related

Problem With Space Allocated For Transaction Log Space

Dec 5, 2001

Hello,

Somebody know how to reduce the space allocated for the transaction log space for my SQL_DB ?

3700 MB allocated but only 100 MB used and 3600 MB are free !

Transaction log properties :
Automatically grow file are filled
file growth by percent = 5%
maximum file size - restrict filegrowth = 3700 MB (we can't reduce it !)

Thank you for your precious help !
Khaix from Brussel.

View 1 Replies View Related

Suppress Multiple Space To Single Space..

Nov 14, 2006

How do we suppress multiple spaces to a single space in T-SQL

E.G.

Field: FullName

e.g.

WOMENS HEALTH RIVER VALLEY
JOHN FAMILY MED GROUP
HERSH STWEART P.
PARK HEIGHTS MEDICAL CENTER
KOPP WHITEFIELD E

The o/p wanted is

HERSH STWEART P.



Thank you.


View 3 Replies View Related

Space Error But I Have Enough Space

Nov 24, 2000

I made some copy of table and I have this error but on my hard disk i have 4 gig of empty space.

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Could not allocate space for object 'Backup_Date_11_24_00_Time_9_08_34_AM' in database 'LogActiviteIntramedia' because the 'PRIMARY' filegroup is full.

/Intranet_API/Forms/videTableLog.asp, line 16

My question is how can I increase the space of primary filegroup?

Thanks and have a good friday

View 2 Replies View Related

Selecting A View And Selecting FROM A View Is Wildly Different

Feb 21, 2006

A colleague of mine has a view that returns approx 100000 rows in about 60 seconds.

He wants to use the data returned from that view in an OLE DB Source component.

When he selects the view from the drop-down list of available tables then SSIS seems to hang without any data being returned (he waited for about 15 mins).



He then changed the OLE DB Source component to use a SQL statement and the SQL statement was: SELECT * FROM <viewname>

In this instance all the data was returned in approx 60 seconds (as expected).





This makes no sense. One would think that selecting a view from the drop-down and doing a SELECT *... from that view would be exactly the same. Evidently that isn't the case.

Can anyone explain why?

Thanks

-Jamie

View 2 Replies View Related

Selecting NOT TOP 1

Jun 10, 2004

Hi,

I am trying to select all entries from a database apart from the top/latest entry, via a stored procedure.
Below is the code that i have but i am doing it wrong somehow.

Any ideas?

Thanks


CREATE PROCEDURE spNEWSARCHIVE AS

SELECT *
FROM tblNEWS
WHERE NewsID NOT TOP 1
ORDER BY NewsID DESC
GO

View 7 Replies View Related

Selecting A Set For Min Value

Apr 14, 2006

Hi,I have the following set and would like to select all rows that havemin value of column 4 for a given column 1 and 2 group, irrespective ofcolumn 3, as below:C1 C2 C3 C4---------------------A B x 5A B y 10A BB XX 55A BB YY 11AA CC z 1AA CC zz 11Need---A B x 5A BB YY 11AA CC z 1using sql server 2000 (which does not provide rank or partition by)Thanks in advance,Tamas

View 2 Replies View Related

SDS Selecting Even Though I Cancel

Sep 5, 2006

Hello,I have a gridview bound to a sqldatasource control.  I have an emptydatatemplate setup.  In the selecting event, I make sure that an actual select has been performed (and not on null data); however, I have cancelselectonnullparameters set to true to stop it, because initially it will be null.However, the selecting event runs, even when I cancel it, the emptydatatemplate shows up.  How do I prevent that from occuring?

View 2 Replies View Related

Selecting Nothing With SQL Statement

Jan 7, 2007

Hi Folks,
You can select all fields with:SELECT * FROM [TableName]
How do you select NOTHING or NONE with a SELECT statement?
Thanks

View 4 Replies View Related

Selecting Between Two Times

Feb 19, 2007

Dear All,
 I need to select records between two datetimes.
My Database Structure and sample values are as below
Fromdate                                                        ToDate
2007-02-20 09:00:00.000                                 2007-02-20 12:00:00.0002007-02-20 08:00:00.000                                 2007-02-20 12:00:00.0002007-02-20 06:00:00.000                                 2007-02-20 13:00:00.000
Query i used
select * from tablename where ((fromdate between Convert(datetime,'2007-19-2 10:00',103) and Convert(datetime,'2007-19-2 11:00',103)) or (todate between Convert(datetime,'2007-19-2 10:00',103) and Convert(datetime,'2007-19-2 11:00',103))) 
My query is not returning values when i am querying between '2007-19-2 10:00' and '2007-19-2 11:00'
Please help
Thanks
 
 

View 5 Replies View Related

Selecting Distinct

Jul 18, 2007

 Hi, This is quite an obvious problem, but for some reason I can't think through the solution. I have two columns, a datetime (datecreated) and an id (FK)  othertableid (id)what I would like to be able to do is select a list of id and datecreated, but only chose the latest row for each id.So I guess it's a bit like a distinct on the id column, but ensuring the date returned is the top date. Please help 

View 1 Replies View Related

Selecting Record

Sep 4, 2007

Hi i was wanting to know how to select a record in a gridview. I have a gridview with firsname and lastname. I currently have select command on it but don't want it. I want to be able to select first name or last name and have it take me to that record on the database.  

View 3 Replies View Related

Need Some Help On SELECTING Event

Apr 21, 2008

hello all,
i have a nested gridview. how do i add a SELECTING event for this datasource for my inner gridview? because i need to increase the commandtimeout. thnx.
   private SqlDataSource ChildDataSource(string strCustno)    {        string strQRY = "Select ...";        SqlDataSource dsTemp = new SqlDataSource();                dsTemp.ConnectionString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString  ;                        dsTemp.SelectCommand = strQRY;                return dsTemp;    }

View 1 Replies View Related

Sql Ranged Selecting

Jun 15, 2008

How can I select data between Mth row and Nth row from a specific search condition? for example , I want to get the 5th to 10th employee who is born in March and ordered by their name.

View 1 Replies View Related

Do While Skip In Selecting...

Oct 21, 2004

Hello:

I have one table and it contains a column named ID Number, and a column named Date. I have a Do While statement that runs a SQL select statement a few times based on the number of records with the same ID Number. During the Do While statement the information is copied into another table and deleted from the old table. After I look at the results, I see that at the second Do While loop, the data was not selected and the Select statement did not run... so the old variable value from varValue is used again... Any reasons on why?

Here is a code snippet of what is going on:
Do While varCount < varRecordCount
conSqlConnect.Open()
cmdSelect = New SqlCommand ("Select * From temp_records_1 where [id number]=@idnumber and date<@date", conSqlConnect)
cmdSelect.Parameters.Add( "@accountnumber", "10000" )
cmdSelect.Parameters.Add( "@date", dtnow )
dtrdatareader = cmdSelect.ExecuteReader()
While dtrdatareader.Read()
If IsDbNull(dtrdatareader("value")) = false Then
varValue = dtrdatareader("value")
End If
End While
dtrdatareader.Close()
conSqlConnect.Close()

'#####The information above is copied to another table here
'#####The record where the information was received is deleted.

varCount = varCount + 1
LoopAny ideas?

View 2 Replies View Related

Selecting * WHILE Converting

Jun 2, 2005

I have a tbale with maybe 30 columns and I'm selecting all where a
record number matches a parameter I've passed.  That works fine,
however is there any way to do some conversions to fields when
selecting without having to list out each column?  For instance
this is what it looks like now:

SELECT *
FROM Losses
WHERE @AppRecord = AppRecord
ORDER BY Record ASC

But I want to convert say one column, is there a way to keep similar syntax instead of listing out each column?

SELECT *, CONVERT(varchar(15), [Losses]) as [Losses]
FROM Losses
WHERE @AppRecord = AppRecord
ORDER BY Record ASC

And the column I'm converting is of type 'money'.  I'm converting
it to get rid of the extra zeroes at the end.  If you know a
better way to do it I'd be interested in knowing.

View 4 Replies View Related

Selecting The Same Field Twice

Sep 6, 2005

CREATE PROCEDURE {databaseOwner}{objectQualifier} [PreciseData_IssueTracker_GetAllIssues]@moduleId intASSELECT PreciseData_IssueTracker_Issue.id AS 'issueId',PreciseData_IssueTracker_Status.name AS 'statusName',PreciseData_IssueTracker_Issue.subject AS 'subject',PreciseData_IssueTracker_Type.name AS 'typeName',Users.Username AS 'assignedUserName',Users.Username AS 'raiserUserName',PreciseData_IssueTracker_Issue.raiseDate AS 'raiseDate'FROMPreciseData_IssueTracker_Issue INNER JOIN PreciseData_IssueTracker_Status ON PreciseData_IssueTracker_Issue.statusId=PreciseData_IssueTracker_Status.idINNER JOIN PreciseData_IssueTracker_Type ON PreciseData_IssueTracker_Issue.typeId=PreciseData_IssueTracker_Type.idINNER JOIN Users ON Users.UserID=PreciseData_IssueTracker_Issue.assignedUserIdINNER JOIN Users ON Users.UserID=PreciseData_IssueTracker_Issue.raiserUserIdWHERE PreciseData_IssueTracker_Issue.moduleId=@moduleIdORDER BY PreciseData_IssueTracker_Issue.raiseDate DESCGOHow do i make it work?

View 1 Replies View Related

Selecting Fields On The Fly

Sep 20, 2005

Hi

I have a content management system that I am building. My CMS has a
pages table which contains 60 fields, some are varchars, some are ntext
some are dates etc. They have field names which match their purpose
like varchar1, ntext3 etc. These fields are used up depending on which
template is applied to the page.

The templatefields table holds holds the information about each field
in a template. It's control type (rich text control, date control etc)
and the field in the pages table that the data will be stored in
(varchar1,ntext3 etc)

What I want to be able to do is loop through the templatefeilds table
for a particular template and then using the field name for the pages
table, go to the pages table and get the value to populate the control.

So to clarify, I would like to produce a stored procedure which outputs
the page field name (varchar1) from the templatefields table and
varchar1's value in the pages table. Maybe in a temporary table.

Is this possible?

Any guidance would be appreciated..

Thanks in advance

View 1 Replies View Related

Selecting A Date

Mar 23, 2006

Hi --
What is the proper way to select results with a date in the where statement when the datatype of the column is datetime?
select * from table where date_field = '3-23-2006'     does not get any results.
 
Thank-you for your help.
 

View 4 Replies View Related

Please Help!!!!! Selecting Rows

Jan 7, 2002

how can I select 10 random rows from a table?
Please help

View 2 Replies View Related

Selecting Indexes

May 8, 2001

We are developing an Access application that will be used to run adhoc reports against a SQL Server table. Selection criteria is entered on a form, a passthru query is built on the fly, and the results are formatted for output via an Access report.

There are 16 different fields on the query form. Two are date fields (from / to), the rest are text. The user is required to supply a date range for the report. They may specify any combination of the remaining query fields.

Examples:
From/To dates, part number, work order number
From/To dates, location, operation, sales order number, operator

What is the best scheme to use for the indexes? One index for each potential query field? Or, a single index that includes ALL query fields? Or, some other combination?

I should also mention that there will be no realtime updates to the table. On a weekly basis, we will import updates from a mainframe extract (dropping the indexes prior to the import, rebuilding them afterwards).

View 1 Replies View Related







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