How Can I Use The Use Statement With Database-name Contains Spaces In Sql2000

Jan 20, 2006

example :

i cann't write :

use [my db]

what can i do with this problem ?

View 1 Replies


ADVERTISEMENT

Xp_cmdshell Statement Worked In SQL2000 Not In 2005

Dec 7, 2007

Code Block
Hi All,

I've got a stored procedure called from a trigger on another database. There are two xp_cmdshell statements in the procedure. One writes a couple variables, passed from the trigger, into a text file. The second fires off an executable that uses the text file via a batch file.

Here's the code that worked on the old 32bit SQL2000 box





Code Block
begin
declare @cmd varchar(150)
select @cmd = 'echo ' + @sVariable1 + ',' + @sVariable2 +' > c:aFolderTextFile.txt'
exec master..xp_cmdshell @cmd

declare @cmd2 varchar(150)
select @cmd2 = 'c:aFolderRun.bat'
exec master..xp_cmdshell @cmd2
end






The new box is 64bit SQL2005. When invoked the stored procedure executes without an error. The textfile is written sucessfully. But, the executable called from the second xp_shell statement does not produce the expected result. Because there is no error I'm having trouble determining where the failure lies.


To troubleshoot the problem I've tried:



Running the batch file from the command prompt in the system32 directory... Success


Using sp_xp_cmdshell_proxy_account to be sure of the credentials of the running xp_cmdshell... Failure

My questions:

Does 64 Bit SQL2005 have a different set of parameters when invoking an executable from xp_cmdshell? ie Do I need to rewrite the batch file?
Is there another way call an executable, SQLCMD maybe?

Any help is appreciated...




Code Block
The batch file if you're curious:

"c:Program Files (x86)someVendersomeAppsomeEXE.exe" "C:aFolderTextFile.txt"








View 3 Replies View Related

Is There A TSQL Statement To Delete File Like Xp_delete_file For SQL2000

Jun 29, 2006

I know there is a command xp_delete_file for SQL 2005 but if I want to delete a file from a 2000 database is there a command to do the same.

View 4 Replies View Related

SQL2005 Cannot Backup A Restored SQL2000 Database With Unknow Database Full-text Catalog Database

Nov 15, 2007



We replicate a SQL2000 database (DataBaseA) to a SQL2000 database (DataBaseB) by using the Restore function and hasn't change its logical name but only the physical data path and file name. It is running fine for a year. We use the same way to migrate the DataBaseB to a new SQL2005 server with the Restore function and the daily operation is running perfect. However, when we do the Backup of DatabaseB in the SQL2005, it just prompt the error message


System.Data.SqlClient.SqlError: The backup of full-text catalog 'DataBaseA' is not permitted because it is not online. Check errorlog file for the reason that full-text catalog became offline and bring it online. Or BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Smo)


Please note we left the DataBaseA in the old SQL2000 server.


Please help on how we can delete the Full-text catalog from DatabaseB so we can do a backup


Many Thanks

View 1 Replies View Related

Spaces In SQL 7 Database Names

Mar 7, 2000

Hey all,

Hope I can get some help here.

Have a view that has to reference a table in another database on the same server. This isn't the problem. I am just using Databasename..tablename in the from statement. Get the results required in testing.

The problem is that in production the table name has a space character. i.e. 'accounting info' would be the table name. I have not been able to figure out the proper syntax to capture this properly to reference in the from statement.

I have tried enclosing the name in ' ', " ", [], (), {} and just about every combination I can come up with.

Any help in this would be great, and changing the databse name isn't an option at this time.

Thanx,
Chris

View 3 Replies View Related

Inserting Text Into SQL 2005 Database Padded With Spaces

Jan 2, 2007

I have a Detailsview with Insert and Update options connected to a SQL 2005 table with templated textboxes for input. The textboxes have maxlength set to the number of characters in each respective field in the SQL 2005 table. When text is inserted it gets padded with spaces if all the field length is not used. When you try to edit the field the cursor does not move because of the padded spaces. The End key must be pressed to find the end of the string and the padded space removed before adding edited text. I am working in VB.net. If I check the field in SQL Studio Express is shows the text I typed plus blank space for the remainder of the field.
My question is how can I add text to the textboxes without the padded spaces being added when the maxlength of the field is not used?

View 3 Replies View Related

Migrating From Sql2000 MSDE Database To Sql2005 Express - Attach Database Errors

Apr 23, 2006

I have a medical records system, SoapWare v4.90, that uses MSDE (SQL2000) databases. Due to the 2gb limitation, I am trying to migrate over to SQL 2005 (Standard or Express) which I have heard works fine. The SoapWare has a datamanager that allows me to log in to the MSDE instance, detach the SoapWare databases from msde (as well as do backups, etc) which I can confirm are detached.

Then I log back into a SQL2005 database instance using the datamanager and try to attach the database. This is what their pictured instructions demonstrate. However, I get the following error:


Database 'sw_charts' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.


Of course, some of the entries will be read only, since doctors have to sign off the charts and are not allowed to subsequently change them.  But I should still be able to switch over to sql 2005?!?!?!?


Or... is there a way to attach the databases to SQLExpress manually?

Help pls?

View 1 Replies View Related

Can I Restore SQL2000 Database To SQL 7.0?

Mar 8, 2002

many thanks!

View 1 Replies View Related

Restore From SQL2000 Database

Aug 2, 2007

Hi all

We have a lot of SQL2000 databases and would like just backup and restore to SQL2005.

Is there anything that I need to look/aware at it apart of DTS stuff (we are not using much DTS).

Does the Level80 sets on SQL2005 for each database will have backward compatibility with SQL2000?

Thanks

View 15 Replies View Related

Moving A SQL7 Database To SQL2000

Dec 27, 2002

Can anyone tell me of an EASY way to migrate a a database from a SQL 7 server to a SQL 2000 server (two different machines)?

Everything that I have found is only for upgrading SQL 7 to SQL 2000 and this isn't what I need.

Two groups in our company merged into one. The first group has a SQL 7 server that the lease is about to expire on and the second group (mine) has a newer SQL 2000 server that we need to move all of the databases to.

I have tried DTS. It failed. I tried backing up the 7 server and restoring to the new server. It failed.

Are there any other suggestions?

Thanks,
Steve

View 4 Replies View Related

Restoring SQL7 Database To SQL2000

Feb 17, 2004

Hi all

just a quick question for you. has anyone had any problems restoring a SQL7 database to a SQL server 2000?

is there anything special you have to do to get it working?



thanks for your time.



Andrew.

View 1 Replies View Related

Shrinking SQL2000 Database W 20 Datafiles.

Jul 23, 2005

Hello,I am trying to clean up a database I inherited.I have an 80GB SQL 2000 database with 20 datafiles each 4096 in size. Ihave been able to remove unneeded data and am now trying to clean up.If I do a Shrink on each datafile would able to recover on average 2gbout of 4g, however I would prefer to have 10 full datafiles and 10empty. (or better yet 5 full 8GB datafiles and 15 empty)Can someone point me in the right direction on how to move the dataaround so that dont have 20 partially filled datafiles?I have noticed that I can shrink a single file and use the "empty thefile option (and move data to other files in the group)." option. Ihave already done this to the last 2 datafiles as a test but not surehow to do this on a large scale. I have also set the 1st 10 datafilesto be able to grow to 8 GB.For lack of a better way to say this, Is there a way to defrag orreorganize the data ables so everything "moves to the front".BTW, I have already run a maintenance plan to reorganize the data andindex pages.

View 2 Replies View Related

Moving Database From Sql2000 To Sql2005

Mar 28, 2008

I am planning to move the sql server 2000 database to the sql server 2005 database. I have to restore that by using the back up copy. Do I need to follow any special instructions or just like moving from one server to another. Could some body help with this. Thanks!

View 5 Replies View Related

How Can I Transfer Stored Procedure From One Database To The Other In Sql2000?

May 21, 2008

hi,
I need to transfer my new stored procedure from local database to the database of my site.
What should I do? Could I use DTS ? I  have built my databases in SQL2000
Please help me.
Thanks alot.

View 2 Replies View Related

Any Affect With Database If I Upgrade MS SQL7 To SQL2000 ?

Mar 17, 2001

Im using MS SQL7 as database software ,but now I plan to upgrate SQL7 to SQL2000 . I would like to know that are there any affect on the old database that already use with sql7 after I upgrade to MSSQL2000 ?

Thanks

View 1 Replies View Related

Can I Export/attach A MS SQL 2005 Database To MS SQL2000 ?

Feb 13, 2007

I know I can go from 2K to 2005, but can I go the other way ?

Thanks

View 1 Replies View Related

Loading A SQL2000 Database To A SQL7 Server

May 30, 2001

Is there a way I can load a SQL2000 DB backup onto a SQL 7 server? Thanks.

View 1 Replies View Related

Restoring A SQL2000 Database To SQL2005 On A New Server

Apr 23, 2008

If I restore a SQL 2000 DB into 2005 it upgrades it for me.
When restoring a DB to a new server/instance of SQL, in SQL 2000 I had to carry out the sp_changedbowner procedure after the restore was complete.
Is the equivalent procedure when restoring a SQL 2000 DB to 2005 to go to the schema for the restored database, find the schema with the name of the SQL 2000 db owner and change the schema owner?
OR alternatively run the following query where mark is the db owner in 2000 and lladmin in the new user in 2005 ;


ALTER AUTHORIZATION ON SCHEMA::mark TO lladmin;

GO

View 1 Replies View Related

SQL2000 Mainenance Plan Database Backup Fails

Dec 3, 2001

The database is SQL Server 2000. Recover Plan = 'Simple'. Maintenance Plan always fails when DBCC tries to put database in single-user mode so it can do the backup, if there is a user has a connection to it from EssBase. No queries running - just a connection. How can I get SQL Server to automatically kill the connections so it can do the backup?

View 2 Replies View Related

Fast Uploading Data From Client To SQL2000 Database

Mar 4, 2005

Does anyone know how to upload (bulk) data from a client (written in Excel VBA) to a remote SQL2000 database? Of coarse I tried "INSERT INTO" and rst.addnew but I noticed this is much, much slower as downloading from the same remote database.

Thanks.

View 3 Replies View Related

Copy Records From 2005 Express To SQL2000 Database

Jul 9, 2007

I have an application which stores records on a local SQL Express and I need to move the records to a SQL 2000 database. I have the SQL 2000 server linked in the Express Management Console (under Linked Servers). I'm trying to use a stored procedure to accomplish this, but get an error "Invalid object name 'ngtxa4-rsmsz-01.newpurchase.tblRequest'." Express uses a table named tblTRequest in the TempPurchase database, while 2000 uses a table named tblRequest in a NewPurchase database. Here is the stored procedure I'm using:
USE [tempPurchase]
GO
/****** Object: StoredProcedure [dbo].[InsertRequestToMain] Script Date: 07/09/2007 08:54:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[InsertRequestToMain]
AS
BEGIN
INSERT INTO [ngtxa4-rsmsz-01].newpurchase.tblRequest
(fldRequestDate, fldRequiredBy, fldUserID, fldWorkAreaID, fldVendorID, fldClassID, fldEstimate, fldMemo, fldStatusID, fldStatusDate, fldSystemID,
fldtmpRequestID, fldUpdateCode)
SELECT fldRequestDate, fldRequiredBy, fldUserID, fldWorkAreaID, fldVendorID, fldClassID, fldEstimate, fldMemo, fldStatusID, fldStatusDate, fldSystemID,
tmpRequestID, UpdateCode
FROM tblTRequest
WHERE (fldHold = 0)
END

Any assistance with this would greatly be helpful. Thank you.

View 2 Replies View Related

Database And Logfile Growth When Attaching SQL2000 DB To SQL2005

Jun 25, 2007

Can anyone tell me why my SQL2000 database has grown aprox 15 % and my Log file 20,000 % when I attach it to SQL2005 .I've Thousands of Databases to Upgrade, but with the log file increasing to more than the size of the Database Its going to be a struggle !

It also takes a fair ammount of time to attach,

I suspect there is some reindexing going on , as when I try to reattach to SQL 2000 I get index errors ?

Is the re anything I can do in advance to reduce the database growth ?

I know I can truncate the log afterward but the peak diskspace consumed during my Migration may be an issue !



Thanks for any help

View 2 Replies View Related

Is There A Problem Detaching A Database From SQL2000 And Attaching It To SQL2005?

Dec 5, 2007

Hi

I have to migrate a SQL2000 database to SQL2005, I tried to use CopyDatabase Wizard (CDW) but invariably stopped all processes (may be for permissions, but I really I don€™t know) so I decided to detach de database, copy files to new server and attach it to SQL2005, it apparently works well, except for the fact that Schemas where created with the name of the users of SQL2000.
Is that correct?
Could it affect the performance or any other thing?
Is correct to do what I did?
Could be another problem in the recently attached database?
(Compatibility, data loss, corrupted structures, collation or something like that)

The server I am using is in a domain, it has windows server 2003 R2 SP2
@@Vesion returns

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
Feb 9 2007 22:47:07
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

And in the source server with windows 2000 SP4
@@Vesion returns

Microsoft SQL Server 2000 - 8.00.194 (Intel X86)
Aug 6 2000 00:57:48
Copyright (c) 1988-2000 Microsoft Corporation
Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)


Thank you in advance

Any comment will be greatly appreciated

JAPonce

View 4 Replies View Related

Sql2000 && Sql2005, Want Localhost To Use Sql2000

Sep 17, 2006

 i have sql2000 & sql2005 on the same machine. I am unable to register my localhost in sql2000, get an access denied error. How can I make my localhost use sql2000 database?

View 1 Replies View Related

Migrate SQL2000 To SQL2000

May 13, 2008



i am in the process of Migrating SQL 2000 to my new SQL2000 server i want to know the what would the best way for me to migrate one SQL server to another SQL server on the same network and rename the new server to the old server and bring it up for use in our ecommerce website.

View 10 Replies View Related

SPACES

Sep 24, 2001

Please how can remove spaces on a date field and a text field. THanks.

View 1 Replies View Related

Spaces In A Sql Server

Nov 19, 2007

i collected the users information without using any trim fucntion(i have implemented now)
but the data which has been already posted into my server has text with some white spaces at the beginning of data
now how to remove this white spaces in this column in online server data.
the data is something like this
mycolumn 
data
  data
data
    data
 
so how to remove white spaces in the above column

View 3 Replies View Related

Add SPACES In Data

Apr 22, 2008

Hi
i have 1 query please guide me,
SELECT P.ProjectName, REPLACE(SPACE(TU.TaskOutlineLevel), ' ', '__') AS dash,TU.TASKISSUMMARY AS TASKSUMMARY,
here i want to add  BLANKS but not working so i have to show add spaces using  __ here any idea i can add SPACES or '  ' here.
please let me know if any. basically i want to align the data in my GRIDVIEW
Thanks in advance
Parth

View 4 Replies View Related

Remove Spaces

Apr 12, 2006

How can you remove spaces in the middle of a string, RTRIM and LTRIM does not work

View 1 Replies View Related

White Spaces

Jan 8, 2002

Creating a text file using DTS, is there a function/way to take out white
spaces from columns. Example:
'1234 ','567 ' would come in text as
'1234','567'

Thanks in advance.

View 2 Replies View Related

Spaces On An Insert

Jan 7, 2003

Hi,

I am building my insert statements dynamically and am finding that there are spaces after certain integer fields.

example Insert Table A (col1, col2, col3)
values (1 ,'2',3 )

If col1 and col3 are integer fields, is there any affect to either how the value is stored or how it will be retrieved when the table is used in a join. By inspecting the values in the table, it seems fine. Do I need to worry?

Thanks,

Jim

View 1 Replies View Related

Trailing Spaces

Apr 28, 2003

If I run SELECT Len(' ') it returns 0, if SELECT Len('a ') it returns 1
I need this to return the correct length including the space that on the end. I thought it was an ansi_padding problem but even turning padding on results in a 0 length. Any ideas? Thanks!

Todd

View 2 Replies View Related

Erasing Spaces!

Apr 28, 2004

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

I am tring to join two tables. There is one problem of course. There is one column I would be able to join the two tables by. This column would be Loc_Code. The only problem is that both columns are not exactly the same. They look like this:

Table 1 Table 2
Loc_Code Loc_Code
A 12345 A12345
A 12346 A12346
A 12347 A12347
A 12348 A12348

I need to erase the spaces that exists in the Loc_Code column in table 1 so that I can join with table 2.


All help would be appreciated.

View 9 Replies View Related







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