Spool File Without An Extension Name
Feb 2, 2008
Hello there!
I am in need of urgent help. i do believe that when you used the command SPOOL filename without specifying an extension name, it automatically puts an .lst extension name. Can you help me identify if there is any way i can generate a file without an extension name? I am in need of help right now. I hope someone will answer my post as soon as possible. I really really appreciate it!
Thanks,
Jen
View 1 Replies
ADVERTISEMENT
Jul 20, 2005
What causes the query optimizer to choose a table spoollazy spoolaction in the execution plan? The explanation of "optimize rewinds"makes little sense because my query never comes back to that table.I'm going to have to change the query but it would be helpful if Iknew what I should be trying to avoid.David
View 1 Replies
View Related
Sep 18, 2005
Hi friends,
Suppose that I want to generate an script that has a
"DROP TABLE <table_name>;" for each table in one of our databases.In Oracle I can do this using "spool" command in "SQL Plus" which is a commandline utility somewhat like isql or osql(I don't know these two perfectly! ).For example:
Code:
spool c:DropAllTables.sql
select "DROP TABLE "||table_name||";" from user_tables;
spool off
And this will generate that script with many drop within that.Would you please clarify me, if there is such a thing in SQL Server 2000?
-Thanks a lot
View 1 Replies
View Related
Jan 29, 2008
you can use OSQL or BCP in a command line
the command line is something like that :
osql -UMyUser -PMyPwd -DMyDatabase -Slocal -i query.sql -o ficspool.txt -e
View 4 Replies
View Related
Jun 9, 2015
I am running backups on SQL Sever express and I take backups via the batch file executing the TSQL as below. This works perfectly fine, I just need to be able to spool out the backup completion log. What TSQL command can I use to do that?
My batch file looks like this:
@echo off
sqlcmd -S SERVER01 -E -i H:master_scriptsTOM_FAM_log.sql
Which will the call the TOM_FAM_log.sql :
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
SET @path = 'H:BackupTOM_FAM'
[Code] ....
Usually if we schedule the backups using the maintenance plan, we can chose reporting options that can spool the result of the backup to a text file. What is the T-SQL for the spool report to a text file.
This option produces a file that writes logs with the details I posted below. I would like to do the same or similar using T-SQL in my code.
Microsoft(R) Server Maintenance Utility (Unicode) Version 11.0.3000
Report was generated on "SERVER01".
Maintenance Plan: Backup logs
Duration: 00:00:00
Status: Succeeded.
[Code] ....
View 1 Replies
View Related
May 8, 2015
I checked quickly one network  and I ran into the folders; I found out the folder MSSQL backup, nothing strange so far. Within that folder, anyway, I found out several backup and one very huge file (datawarehouse) with extension FILE. I am wondering what can be? I got datawarehouse mdf of course and datawarehouse log but what is that huge file (1 TB)?
View 6 Replies
View Related
Sep 27, 2006
I was told by my website provider that they do not support the .mdf extension and only support the mdb extension. What am I not getting here? I am using SQL Server Express 2005. Is .mdf a subset of .mdb?
View 1 Replies
View Related
Aug 16, 1999
Hi,
I need to read a binary file with extention *.dat like this:
tat.dat and import it in ms sql server 7.0.
Thanks for any help
Dr Bangaly Diané
View 2 Replies
View Related
Oct 25, 2006
Hi,
If access database has an extension of .mdb then what is sqlserver2000 file extension?
View 1 Replies
View Related
Jul 20, 2005
Hi All,I am receiving the following message when I run Dts package which iscreating a cube.Error Source : Microsoft Data transmission Services (DTS)PackageError Description: File name or extension is too longAny help will be appreciated!Thanks in advance,Mohammed SarwarOcp dba oracle 9i,8i,8.0*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View 1 Replies
View Related
Jan 4, 2006
In document for encryption in SQLServer with application XP_Crypt, i see file with extension .pem when using private key or public key. How to create file .pem. Please explain me private key or public key.
View 1 Replies
View Related
May 14, 2008
Hi,
I'm trying to change the file extension of one of the database files of a big database that contains 10 years of EPOS data.
When this file was created, at the beginning of 2008, with the following script:
USE [Live]
ALTER DATABASE [Live] ADD FILE (NAME = 'Live_2008',
FILENAME = €˜E:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataLive_2008') TO FILEGROUP [2008]
the .ndf file extension was not added to the filename. So the file now has a file type of "File", instead of "SQL Server Secondary Data File"
I tried, in a test environment, to bring the database offline, change the filename to "Live_2008.ndf" and bring the database back online, but it gives me an error message saying that "cannot open the Live_2008 file", i'm guessing because it's looking for "Live_2008" and it finds "Live_2008.ndf" instead.
This file is quite big (5Gb) and I cannot afford to risk to lose any data.
The situation is complicated even further by the fact that it seems that a partition for 2008 does not exist.
How can I find out what data this file contains?
Is it going to be an issue if I leave the file like that?
Thanks
View 3 Replies
View Related
Jul 5, 2006
I set up a basic ForEach enumerator loop and specified files of type *.sql.
In the directory, I had some files I needed to keep but didn't want the package to touch, so I changed the extension to *.sqlo. Much to my dismay, the ForEach loop picked up those files. (Though it did skip the *.xml and *.bat and a few other types...)
Sounds like a bug to me.
View 3 Replies
View Related
Sep 26, 2007
I programmed a Source extension, that accesss a text file. In my code I have the following code to open a file:
protected override void reader(PipelineBuffer buffer)
{
TextReader reader = File.OpenText(_filename);
The komponnet works well. How do I grant permissions to access this text file? Because I got problems when I try to run my package using a task created in the SQL Server Agent.
View 3 Replies
View Related
Apr 18, 2007
i have sql server 2000 db with two data file... primary data file has extension mdf and secondary file has extension ndf (as per microsoft recommendation)..
when i try to backup the db and restore thru the enterprise manager .. in the restore -> options window ... i see both the files has the same extension mdf.. and when the restore completed, the new database still has extension mdf for both the file..
why this behaviour?
* i even try to create a new test db with two files, still its the same behaviour.
View 10 Replies
View Related
Dec 8, 2008
I have just begun to try out differential backups. Almost every reference I found on the internet said to use a .dif file extension. Books Online "Back Up Database Task (Maintenance Plan) MS.SQLCC.v9/MS.SQLSVR.v9.en/uirfsql9/html/ed1ef012-fa14-4ba5-bafe-d1527ba065b3.htm only says :
Backup file extension Specify the extension to use for the backup files. The default is .bak.
                                                                                                                                  Â
Using .dif for the differential shows "Microsoft Office Excel Data Interchange Format" as the type when looking at the backup folder. URL... indicates that .dif has 11 different uses, including "Difference data file." In a couple of posts in this forum in April and May of this year David Dye said that the file extension for differential backups is .bak, the same as for the full backup.
Â
If this is the case, this would cause a problem with our maintenance plan policy which is to retain the two most recent backup files on the server. If we do a full backup for the base on the weekend and differential backups the rest of the week, our full backup would have to be restored from out tape system before we could do a restore. Recoveries are pretty rare, but when we get that panicked phone call that someone accidently deleted all the records of a major client, time is of the essence in getting that point in time restore done.
View 6 Replies
View Related
Apr 18, 2007
Hello,
I try to add an data extension who take the information to connect to the database in a config file. But It's could not retreive the values corresponding to the key.
I'm using the class ConfigurationManager from the namespace System.Configuration.
ConfigurationManager.AppSettings["QueryModel"]
Without the config file, the extension is working well.... I got the impression that reporting service and Visual Studio BI don't find the config file.
If someone can help me or have some advices. I will be pleased
View 1 Replies
View Related
Nov 30, 2015
I have a source file as filename.mar it is microsoft access report. When I am loading into my database the file name was something like filename.nov (its current month).
When I ran the package its shows error system cannot find the file filename.nov.
View 2 Replies
View Related
Jun 29, 2015
I use an execute sql task and excel connection manager to craete excel file.
Execute sql task:
In the connection:
Â
It works. But when i choose file path to: C:1111.xlsx
And excel version to micorsoft excel 2007. When open the file it created,it promotes the format is not correct. How to solve this?
View 5 Replies
View Related
Feb 24, 2010
When I am saving a SSRS report in excel format in a shared network drive, how can I add the date extension to the filename ?I assume this is something that needs to be handled within the SSRS reporting side rather than the subscription side.
View 5 Replies
View Related
Jun 16, 2015
Using SSRS 2008R2 is it possible to change the file extension of a CSV data driven subscription? Â I'm outputting a text file with a .csv extension, but users have access to these files and I don;t want them opened with Excel and then saved back in an incorrect format.Â
These are the options I have from the report "manage" option. Â
View 2 Replies
View Related
May 6, 2015
I have implemented a package to load multiple files to a destination. Since the source was a txt file, i have created as flat file source. However now we are getting files in excel format as well.
Is there anyway the source gets changed dynamically based on the file extension, output of the foreach file enumerator? I can think one solution to have 2 dataflow tasks based on precedence constraining and expression one is for .txt and other one is for .xls.
View 6 Replies
View Related
Jan 16, 2002
Hi all,
I have a table with the list of tables I need to drop. So basically before droping those tables I need to disable the FK and PK constraints.
So I want to spool out the out of this script.
SELECT 'ALTER TABLE ' +
QUOTENAME( c.TABLE_NAME ) +
' NOCHECK CONSTRAINT ' +
QUOTENAME( c.CONSTRAINT_NAME ) AS ALTER_SCRIPT
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS c
WHERE CONSTRAINT_TYPE = 'FOREIGN KEY'
Is there a way to store the output of this script in a .sql file so that I could execute it.
Any thoughts will help!
Thank you!
View 5 Replies
View Related
Feb 23, 2007
Hi
Can i have the output of my queries on the console window as well as in a text file at the same time something that Oracle's SPOOL command does.
Regards
Salil
View 1 Replies
View Related
Jul 6, 2015
I have a CTE query against a table with 32K rows that runs fine in 2008R2. I am running it in 2014 Std Ed. against the same data and it runs very slowly. Looking at the execution plan I think I see what's contributing to the slowness.
Note that the "actual number of rows" is some 351M...how is this possible?
the query:
declare @amts table (claim int,allowed decimal(12,2),copay decimal(12,2),deductible decimal(12,2),coins decimal(12,2));
;with unpaid (claimID) as (select claimID from claim where amt+copay + disct+mm + ded=0)
insert @amts
select lineID, sum(rc), sum(copay), sum(deduct),
case when sum(mm)>0 and (sum(mm)<sum(mmamt)) then sum(mm) else 0 end
from claimln
where status is null
and lineID not in (select claimID from unpaid)
group by lineID
it's like there's some massively recursive process going on?
View 5 Replies
View Related
Jun 24, 2006
hello ... I am trying to copy 1 field from a table in database called DB1 to a same table in DB2 .. I am not sure if this is possible. I found out form www3.schools.com it's doable using Select Into ... but it uses MS Access for example (Northwind.mdb) ... I wonder what's the extension database in MS SQL? Does anyone know where can we check the query syntax on the web? Can anyone tell me it's correct? I dun have MS SQL from home .. so :(
======copy prodID from DB1 to DB2 table called production1 (both DB1 and DB2)=======
// this is done in SQL QUERY ANALYZER under DB1?
SELECT production1.prodID INTO production1 IN DB2 FROM DB1
=====create VIEW in DB2=======
// this has to be done in DB1 ... if I have multiple databases, is there anyway to do it using something like SELECT INTO to create view in differences databases?
CREATE VIEW production_id AS SELECT prodID from DB1
View 1 Replies
View Related
Feb 18, 2014
I have made the sql server 2008 database backup through proper procedure.I am doing this backup in remote server. The task is completed successfully. But When I check the folder that I made the backup,is showing extension as file,not .bak. Why the backup extension is not proper? And due to that,when I sent this backupfile through mail to someone,that person is not being able to retrieve or restore it..
View 1 Replies
View Related
Jun 7, 2007
I've been using Michaels excellent date function http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519 quite honestly it has saved me loads of time (the e-beers are on me)
For my purposes I need to work sometimes with Financial Years and I also need the Dates available to SQL Server 7. So I used Michaels function to create a table and added two fields (possibly more to follow). Please note that this has only been done on SQL Server 2000
ALTER TABLE DATEINFO
ADD -- Needs these to allow NULL so that the Alter Table will work.
FINANCIAL_YEAR_START_DATE[datetime]null , -- the start date for the financial year
FINANCIAL_YEAR_START_YEAR[smallint]null , -- the year that the financial years starts in depending on the Financial Year Start Date
Given that the table is then populated by Michaels function, to set the FINANCIAL_YEAR_START_DATE I used
/* @ARBITRARY_FINANICAL_YEAR_START_DATE is SET to any date that would be the start date of a financial year
only the day and month parts are important, so in this case the start of the financial year is 1 April
*/
DECLARE @ARBITRARY_FINANCIAL_YEAR_START_DATE DATETIME
SET @ARBITRARY_FINANCIAL_YEAR_START_DATE = '20060401'
UPDATE DATEINFO
SET FINANCIAL_YEAR_START_DATE =
CASE
WHEN DATEDIFF(dd,DATEADD(yy, year([DATE]) - YEAR(@ARBITRARY_FINANCIAL_YEAR_START_DATE), @ARBITRARY_FINANCIAL_YEAR_START_DATE),[DATE]) < 0
Then DATEADD(YY,YEAR([DATE])- YEAR(@ARBITRARY_FINANCIAL_YEAR_START_DATE) -1, @ARBITRARY_FINANCIAL_YEAR_START_DATE)
Else DATEADD(YY,YEAR([DATE])- YEAR(@ARBITRARY_FINANCIAL_YEAR_START_DATE) , @ARBITRARY_FINANCIAL_YEAR_START_DATE)
END
With that it is trivial to set FINANCIAL_YEAR_START_YEAR to YEAR(FINANCIAL_YEAR_START_DATE)
steve
-----------
Don't worry head. The computer will do all the thinking from now on.
View 4 Replies
View Related
May 27, 2007
Guys,
I am running SQL Server 2005 Enterp Trial version, which is about to expire in 14 days..
Is this possible to Extend this?
Or
Un-installing and re-installing may give me back 180 days again? I haven't tried this, but need to know before I do an attempt?
Don't have other machine, don't want to re-built my system..
Any help?
Thanks in advance
SKR
View 6 Replies
View Related
Mar 30, 2006
When rendering extension for RTF or Doc or WordML will be available?
Will it be released in service pack for SQL2K5 or it will be released in next version of SQL Server?
View 3 Replies
View Related
Feb 28, 2008
What is Reporting Service Extension and how can I check that whether it is installed in my PC or not.
And if not then what is requirement for get it installed...?
View 6 Replies
View Related
Apr 17, 2007
We just upgraded to 2005 from a previous installation of 2000. Due to performance issues, I stopped the 2000 instance, and now the following message keeps popping up in the event log:
MS SQL SNMP Extension Agent reconnecting.
Following that, there are the following messages:
ODBC error encountered, State = 08001, native error = 17, error message = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied..
-------------
ODBC error encountered, State = 01000, native error = 2, error message = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Connect())..
-------------
ODBC error encountered, State = 08001, native error = 17, error message = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied..
-------------
ODBC error encountered, State = 01000, native error = 2, error message = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Connect())..
Any suggestions?a
View 3 Replies
View Related
Jul 20, 2005
I have actually extended my requestI have a scenario like this.......update esan set tes_address_city = 'TEST1' --at some timeupdate esan set tes_address_city = 'TEST12' --at some timeupdate esan set tes_address_city = 'TEST123' --at some timebackup database TESTWMS to disk = 'D: empRecoveryTestTESTWMS.db'backup log TESTWMS to disk = 'D: empRecoveryTestTESTWMS01.log'I take these backups at the end of day....Now i want to recover till the second update ie 'TEST12'...Assumptions to be made:-I dont know the timing of the updates.I am allowed to take back only once.We can also assume to have a backup of the previous day also.Is this possible and how can i do it.......Please help me ...and urgent also.......Thanks in advanceRVGExtension is hereSuppose that ou database is crashing at 2.30 and i run the restoreRESTORE DATABASE TESTWMS FROM DISK='D: empRecoveryTestTESTWMS.DB'with norecovery --Prev day logRESTORE LOG TESTWMS FROM DISK='D: empRecoveryTestTESTWMS01.log'with norecoveryRESTORE LOG TESTWMS FROM DISK='D: empRecoveryTestTESTWMS02.log'with recovery, STOPAT = '2003-08-26 16:37:45.870'i get message like thisThis log file contains records logged before the designatedpoint-in-time. The database is being left in load state so you canapply another log file.RESTORE LOG successfully processed 0 pages in 0.389 seconds (0.000MB/sec).Now when i try to run aSelect * i get message lkeServer: Msg 927, Level 14, State 2, Line 1Database 'TESTWMS' cannot be opened. It is in the middle of a restore.How do i solve this problem. One way is to use a NO_TRUNCATE with abackup in between (ie incase of database corruption).But i dont want to use a log backup once again. I should be able tosolve it without using a log backup once again. In shot backup onlyonce a day. Aslo i need to refer to a database to that particularpoint of time from my backup.Thanks in advanceRVG
View 6 Replies
View Related