BACKUP CERTIFICATE Alters ACLs On Created File

Feb 8, 2007

NOONE ASKED FOR THIS!!! why the heck is BACKUP CERTIFICATE altering the file's ACLs - it's just a PUBLIC CERT I'm exporting!!

in additions MS doesn't seem able to add the ability to re-inherit file-rights from parent objects via the command-shell.

I export the public-key for a reason! I want to import it on another machine (automatically) to establish a trust. But this freaking "feature" is costing me HOURS of research on how to get rid of these ACLs on a public certificate!!!

argh!!!

sorry, I really had to get this out!

why not at least give us a switch we can set in BACKUP CERTIFICATE command to stop this from happening?

is there a work-around? now I need to activate
EXEC sp_configure 'show advanced options', 1
and
EXEC sp_configure 'xp_cmdshell', 1
just to be able to issue a (not working) DOS command cacls... to try to fix the "feature".

there's got to be a better way!!!

also - why can't there be a switch to force overwriting the target file, if it already exists? It's a BIG PAIN having to do lots of other stuff, just to be able to "backup" the certificate!

You gave us "xp_FileExist", but no xp_FileDelete with similar parameters!! again, I need to issue DOS COMMANDS just to do stuff I would not have to if someone at the levers was actually activating the back-brain!

PLEASE give me some hints on how MS recommends to solve these features!

View 6 Replies


ADVERTISEMENT

Creating Certificate Thru Backup File

Mar 30, 2006



Hi,

I have created a certificate and now have taken a backup of this file by the following code:

backup certificate EncrProdCode to file = 'C:BackupCertEncrBackup.cer'
with private key(file = 'C:BackupCertEncrPrivKeyBackup.pvk',
encryption by password = 'EncrPrivKeyBackuppwd')

Now i want to create a certificate IN DIFFERENT DATABASE from this file. i m using the following database:

create certificate EncrFromFile from file = 'C:BackupCertEncrBackup.cer'
with private key(file = 'C:BackupCertEncrPrivKeyBackup.pvk',
decryption by password = 'EncrPrivKeyBackuppwd')

But is showing error:

Msg 15232, Level 16, State 1, Line 1
A certificate with name 'EncrFromFile' already exists or this certificate already has been added to the database.

No certificate with this name exists. why i m getting this error. and how can use the same certificate in other database. Is there any other way to create a certificate from an existing certificate file.

Thanks

Gaurav

View 4 Replies View Related

Backup CERTIFICATE Fails

Jun 13, 2006

I've problems with backing up the certificate (on the Witness Server). On principal and mirror, it works fine (Win 2003 Server, US English), but on my local PC (XP Prof, German) what i use as witness Server following backup command raises an error:

USE master;

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'something$Strong123';

CREATE CERTIFICATE HOST_W_cert WITH SUBJECT = 'HOST_W certificate for database mirroring', START_DATE = '01/01/2006', EXPIRY_DATE = '12/31/2050';

BACKUP CERTIFICATE HOST_W_cert TO FILE = 'C:HOST_W_cert.cer';

The error message is:

Msg 15240, Level 16, State 1, Line 1

Cannot write into file 'C:HOST_W_cert.cer'. Verify that you have write permissions, that the file path is valid, and that the file does not already exist.

I connect to the database with a domain user what is a local admin on the witness server (my local user), so this couldn't be a permission reason. The file doesn't already exists, so that is not the problem.

What could it be?

Greetings, Torsten

View 3 Replies View Related

CREATE CERTIFICATE From Backup: Error Message

Jul 16, 2005

Hi,

View 3 Replies View Related

Select Top Alters Order

Jul 23, 2005

If i have two identical queries, with exception of top criteriaSelect top 1 * from photosSelect top 8 * from photoswhy does altering the top critieria alter the order of the returnedresults?

View 1 Replies View Related

Integration Services :: Flat File Error File Being Created In-spite Of No Errors

Jun 23, 2015

I have a package in which there are only one Data flow Task and it has only three components. 1) Source , which is a SQL db 2) destination and 3) OLE DB Destination flat file Error output file.   I want the error file to be created ONLY if there is any error while dumping the data into destination DB. But , the issue is, the error flat file is being created inspite of No error while dumping the  data from Source to Destination.

View 5 Replies View Related

Integration Services :: Get FileName Fo Each File Created Via Dynamic Flat File Destination

Jul 24, 2015

Need to know how I can get the dynamic filename created in the FlatFile destination for insert into a package audit table?

Scenario: Have created a package that successfully outputs Dynamiclly named flat files { Format: C:Test’Comms_File_’ + ‘User::FileNumber’+’_’+Date +’.txt’

E.g.: Comms_File_1_20150724.txt, Comms_File_2_20150724.txt  etc} using Foreach Loop Container  :

* Enumerator Set to: “Foreach ADO Enumerator” with the ADO object source variable selected to identify how many total loop iterations there are i.e. Let’s say 4 thus 4 files to be created

*Variable Mappings : added the User::FileNumber – indicates which file number current loop iteration is i.e. 1,2,3,4

For the DataFlow task have a OLDBSource and a FlatFile Destination where Flat File ConnectionString is set up as:

@[User::Output_Path] + "Comms_File"+ @[User:: FileNumber] +"_" + replace((DT_WSTR, 10) (DT_DBDATE) GETDATE(),"-","")+ ".txt"

All this successfully creates these 4 files:

Comms_File_1_20150724.txt, Comms_File_2_20150724.txt, Comms_File_3_20150724.txt, Comms_File_4_20150724.txt

Now the QUESTION is how do I get these filenames as I need to insert them into a DB Audittable. The audit table looks like this:

CREATE TABLE dbo.MMMAudit
  (
     AuditID      INT IDENTITY(1, 1) NOT NULL,
     PackageName     VARCHAR(100) NULL,
  
FileName           VARCHAR(100) NULL,
     LoadTime        DATETIME NULL,
     NumberofRecords INT NULL
  ) 

To save the Filename & how many records in each file in our Audit Table, am using an Execute SQL Task and configuring it as this:

Execute SQL Task

Parameter mapping - Mapped the User Variable (RecordsInserted) and System Variable( PackageName) to Insert statement as shown below

SQLStatement: INSERT INTO [dbo].[MMMAudit] ( 
PackageName,NumerofRecords,LoadTime)
 (?,?.GETDATE)

Again this all works terrific & populates the dbo.MMMAudit table as shown below BUT I also need to insert the respsctive file name – How do I do that?

AuditID PackageName FileName  NumberOfRecords
1           MMM       NULL                      12
2          MMM  NULL                23
3          MMM  NULL      14
4          MMM  NULL              1                     

View 2 Replies View Related

Automatically Backup New Created Database Once

Dec 26, 2007

Hi,

i've sql 2005 std sp2,and i'm working with a program that create every view month's a new database automatically.

my question is - how can i make a full backup of the newly created database automatically only one time when it's created?

Thx

View 16 Replies View Related

The Certificate, Asymmetric Key, Or Private Key File Does Not Exist Or Has Invalid Format.

Sep 20, 2006

I am sure I'm being dumb here but I am trying to deploy an assembly with external_access.

I have signed the assembly using the <new> option in the project properties.

When I then try and create the Key I get the above error using the code below.

CREATE ASYMMETRIC KEY SQLExtensionUDTKey

FROM EXECUTABLE FILE = 'C:Documents and SettingsSimon SabinMy DocumentsVisual Studio 2005ProjectsSQLBitsCoreSQLExtensionsSQLExtensions.UDTinDebugSQLExtensions.UDT.dll'

What could be the problem?

View 7 Replies View Related

Need To Backup Of Database Created Within App_Data In Asp.net Project

Jun 12, 2007

I create database in App_Data. Now i wish to get backup of this database and also wish to have this database in my sqlserver 05 databases. Please provide a way so that both tasks will accomplished.
Thanks.
With regards
Dev

View 2 Replies View Related

How Do I Restore SQL Express Database From Backup Created?

Nov 1, 2006

Hello,

I have managed to create a backup of my SQL Express database by using the Transact-SQL from article http://support.microsoft.com/kb/241397.

I am not sure if it backed up the correct database, as in the script from the article, there is no where for me to specify my SQL Express database. The back up file that was created after I ran the script is, msdb.dat_bak.

Now if this is the correct database, how can I restore the data into my vb.net project that holds the SQL Express Database?

Thanks in advance.

View 1 Replies View Related

Automate The Creation Of A Backup Job When A New Database Is Created?

Mar 20, 2008

I'd like to be able to create a new database and have a backup plan automatically created for it. Is there a way to do something like this?

Thanks!

View 3 Replies View Related

SQL Server Admin 2014 :: Backup Files Not Created

May 10, 2015

I run the following:

EXECUTE dbo.DatabaseBackup
@Databases = 'F1SB',
@Directory = 'F:SqlBackup2014',
@BackupType = 'FULL',
@Compress = 'Y',
@Encrypt = 'Y',

[code]...

I cannot see the file created in the directory. The account under which sql server the agen job run have full privileges on it and is sysadmin.Then i run the Command in ssms

BACKUP DATABASE [F1SB] TO DISK = N'F:SqlBackup2014<server>F1SBFULLIGS-DB01_F1SB_FULL_20150510_214455.bak' WITH NO_CHECKSUM, COMPRESSION, ENCRYPTION (ALGORITHM = AES_256, SERVER CERTIFICATE = [serverCertificate])

and I get this error message:

Msg 3013, Level 16, State 1, Line 13
BACKUP DATABASE is terminating abnormally.

View 9 Replies View Related

Certificate Loading Issue - When Creating Certificate From SQL Server To SQL Server Express On The Same Machine

Jun 29, 2007

Hi, We are trying to implement Service Broker between SQL Server Express and SQL Server on the Same machine and we are having problems with certificates. We are creating a certificate on SQL Server, backing up the certificate on a file system and then loading certificate on the SQL Server Express from the file and we are keep getting the following error: Msg 15208, Level 16, State 1, Line 1 The certificate, asymmetric key, or private key file does not exist or has invalid format.



Following script runs fine on SQL Server.




Code Snippet

use master



Create Master Key Encryption BY Password = '45Gme*3^&fwu';

BACKUP MASTER KEY TO FILE = 'C:ServiceBrokerPrivateKeyMasterB.pvk'

ENCRYPTION BY PASSWORD = '45Gme*3^&fwu'

Create Certificate EndPointCertificateC

WITH Subject = 'C.Server.Local',

START_DATE = '06/01/2006',

EXPIRY_DATE = '01/01/2008'

ACTIVE FOR BEGIN_DIALOG = ON;

BACKUP CERTIFICATE EndPointCertificateC

TO FILE = 'C:ServiceBrokerEndPointCertificateC.cer'



Following script runs on SQL Server Express:






Code Snippet

Create Certificate EndPointCertificateC

From FILE = 'C:ServiceBrokerEndPointCertificateC.cer'

WITH PRIVATE KEY (

FILE = 'C:ServiceBrokerPrivateKeyMasterB.pvk',

DECRYPTION BY PASSWORD = '45Gme*3^&fwu'

);





If we run the script other way around, it works fine. If we use the SQL Server on some other machine, the script works fine. But only on the same machine, it throws this error. We made sure the permissions and everything. Let us know if there is any work around or what are we doing wrong.



Any help is appreciated. Thank you,

View 4 Replies View Related

BCP - File Is Not Getting Created

Nov 5, 2007



Hi all,

I have been trying to extract table data into file but its not getting extracted. I am using following command to run.


exec spGetIPAddress @ip = @servername output


select @SQL = 'bcp '

+ char(34)

+ ' select Field from ['

+ @DatabaseName

+ '].[dbo].Temp_ExtractSR39'

+ ' order by Field'

+ char(34)

+ ' queryout '

+ @RenamePathAndFile

+ ' -T -c -CACP -S'

+ @servername


exec master..xp_cmdshell @SQL, no_output

Is there any setting need to be done at database level? or any setting for Sql server?

Thanks in adavance,
Anshu


View 3 Replies View Related

Output Column Width Not Refected In The Flat File That Is Created Using A Flat File Destination?

May 11, 2006

I am transferring data from an OLEDB source to a Flat File Destination and I want the column width for all of the output columns to 30 (max width amongst the columns selected), but that is not refected in the Fixed Width Flat File that got created. The outputcolumnwidth seems to be the same as the inputcolumnwidth. Is there any other setting that I am possibly missing or is this a possible defect?

Any inputs will be appreciated.

M.Shah

View 3 Replies View Related

File Not Created From Sp_trace_create

Jun 11, 2006

I am getting a return code of 12 (""File not created"") from sp_trace_create. I have checked to ensure that the path is valid. I am using Windows Authentication and the Windows Administrator account. SQL Server is using the Windows userid that I created for SQL Server. I have verified (at least tried to verify) that the user for SQL Server has access to the folder containing it. The following is the relevant portion of what I am attempting. DECLARE @RC int, @TraceId intExec @RC = sp_trace_create @TraceId OUTPUT, 0, N'C:TraceFile' I have tried other paths that also do not work.

View 1 Replies View Related

Get Created Date From A File

Apr 3, 2008

Hi Guys,
Im new using SSIS and i just created a data flow that reads from multiple flat files (with a mutipleflatfiles conn manager) and inserts the files data to an sql server (with an ole db destination)

The thing is i need to insert the created date property of each file im importing and i dont know how to do this.

I've read i could do this with a script but im not very familiar to it.

Could someone help me there?

View 2 Replies View Related

Has Anyone Created A Thesaurus File?

Feb 25, 2008



Has anyone created a Thesaurus file that is using it? Specifically, has anyone set up a First Name thesaurus file and is it possible to get a hold of it. Why reinvent the wheel if someone has already done this. I am creating a database that needs to return records for fuzzy matches on first names. I don't know what all forms of the names can be such as Robert, Bob, Bobby, Bert or Sue, Suzie, Susie, Susan, Suzanne, etc. and I am betting someone has created something already that can be a starting point at least.


What about the Thesaurus Word currently uses? Does anyone know what the physical file name and location is of the thesaurus file Word uses?

Any help or direction is appreciated.

Thanks

Paul

View 1 Replies View Related

Created .dtsx File How Do I Schedule It?

Mar 27, 2007

How dow you schedule a file(.dtsx)(I think it is a package) that was created in the SQL Server BI Design Studio to run? I can locate the file I created in SQL Server Management Studio and see it in the right hand pane and even edit it. I can run it in the Design Studio, but cant see how to do that in Management Studio nor how to schedule it.


This is my first attempt at recreating a DTS package using SQL Server tools instead of the Legacy conversion wizard, and I think my brain has overheated. I just cant find it on the Management Screen or the Design. I am also not searching correctly anymore on books online because I cannot find it.



Thanks for pointing me to where I need to go or do.


Tracey


View 5 Replies View Related

Mobile Sdf File Created On Server

Aug 15, 2007

Hi there,

Background: I've created an application to run on windows mobile 5.0 devices. It replicates to a publication on a server. To do this it goes through ASP.net. This creates the database on the Mobile Devices.

Issue: Problem is the initial download of the database is taking 2hours plus to replicate (create) for the first time. So I'm trying to create the .sdf file on the server, zip it, and send it across to the handheld. All subsequent replications take about 5 minutes.

Question: Does anyone know how, or have examples for creating a Mobile CE database on the server. I need to create it using ASP.net and go through a pre-existing publication where a hostname used for filtering.


http://msdn2.microsoft.com/en-us/library/ms173009.aspx explains how to create this in SQL Server Management Stuidio. How do you do the same thing over ASP?

Can this be done using SMO? How do you create a SQLServerCompactEdition database using normal .NET Framework? Thanks for your help!!

View 5 Replies View Related

Ms Sql Mdf Database File Attached Vs Created On Sql Server

May 27, 2007

 Hi allI have a question concerning sql database mdf files. In the old days I would user a ms access database. This file would be stored with the actual web files and would utilise a dsn connection. I have noted when designing with vwd 2005 express it allows you to use 2 methods of creating a mdf database. You can either create it as an attachment mdf or you can create it directly using sql manager. My question is, if you create the mdf database as an attachement file can you store it in the same manner as if you where using a ms access database, meaning can you store it with the web site's files so it uses the file storage allocated size and then create a connection similar to a dsn (but for sql) to the isp's sql engine or does it have to be uploaded to the isp' s sql server.The reason for this question is some of my customers do not want to pay the extra cost to have an sql allocation, however I do not want to go back to using old asp methods to create advanced sites as I prefer using stored procedures. Any help will be appreciated 

View 4 Replies View Related

DTS File Created After Stored Proc Executed Now What?

Apr 11, 2005

I'm trying to fire a DTS package through a stored procedure. 
After running my one stored procedure I got my DTS file to create just fine.  However after this point I'm stuck...I can't do anything else with this file and I need to update data with it. 
How would I use the DTS file to update my data.
Thanks,
RB

View 1 Replies View Related

T-SQL Restore Of A File Created Through Maintenance Wizard

May 9, 2000

I am trying to restore a file that was created using Database Maintanence Wizard on a server that is now totally crashed.

I want to use T-SQL to restore the physical file to a new name and location.
Using the backup command, I get the error that I must use the with move option??

What are the required steps to restore from a
physical file (with a bak extention)???

I do not know the original database/log file names. Any advice?

Thanks
Ziggy

View 1 Replies View Related

Created BAT File Just To Make A Directory Not Getting Recognized

Aug 13, 2015

i am trying to run an exe using t-sql command and even through job, but it is giving me issues. But if i double click on the exe it runs fine.

For example i created a bat file just to make a directory - mkdir d:example
double clicking it, a folder is created BUt through
EXEC xp_cmdshell "D:ew.bat"
it gives me error -
'D:ew.bat' is not recognized as an internal or external command,

and when i do with the job with command - @command=N'idhimahajanD$ew.bat',
it gives an error on execution - Executed as user: NT ServiceSQLAgent$PAXAS. The process could not be created for step 1 of job 0x2FCDDE36F160CD4688D2ACE1D748A99E (reason: Access is denied). The step failed.

View 3 Replies View Related

Backup Failed: System.Data.SqlClient.SqlError: Backup And File Manipulation... Must Be Serialized

Jul 11, 2007

Using SQL Server 2005 Server Management Studio, I attempted to back up a database, and received this error:

Backup failed: System.Data.SqlClient.SqlError: Backup and file manipulation operations (such as ALTER DATABASE ADD FILE) on a database must be serialized. Reissue the satement after the current backup or file manipulation is completed (Microsoft.SqlServer.Smo)



Program location:

at Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)
at Microsoft.SqlServer.Management.SqlManagerUI.BackupPropOptions.OnRunNow(Object sender)



Backup Options were set to:

Back up to the existing media set

Overwrite all existing backup sets



I am fairly new to SQL 2005. Can someone help me get past this issue? What other information do I need to provide?

View 11 Replies View Related

SSIS Script Task Alters Package Variable, But Variable Does Not Change.

Oct 25, 2006

I'm working on an SSIS package that uses a vb.net script to grab some XML from a webservice (I'd explain why I'm not using a web service task here, but I'd just get angry), and I wish to then assign the XML string to a package variable which then gets sent along to a DataFlow Task that contains an XML Source that points at said variable. when I copy the XML string into the variable value in the script, if do a quickwatch on the variable (as in Dts.Variable("MyXML").value) it looks as though the new value has been copied to the variable, but when I step out of that task and look at the package explorer the variable is its original value.

I think the problem is that the dataflow XML source has a lock on the variable and so the script task isn't affecting it. Does anyone have any experience with this kind of problem, or know a workaround?

View 1 Replies View Related

How To Automate Date & Time Stamp In A FILE Name Created Via DTS

Dec 13, 2001

Hi,

I would like to know as to how can I put a Current Date & Time stamp on a FILE NAME automatically which is created by a DTS package.

E.g. I create a file named ABC.TXT daily. How do I get this file to have the current Date stamp so that the file name is ABC121201.TXT without any user intervention.

Thanks for the help!

View 1 Replies View Related

Can Table Created On Different File Group Based On Schema

Feb 17, 2012

Provided that we have 2 type of tables, the first type of tables with schema schema_a and the second type with schema schema_b.Also 2 filegroups apart from primary created: filegroup_a and filegroup_b.How can I configure so that when table with schema schema_a created, it can be put on filegroup filegroup_a automatically and when table with schema schema_b created, it can be put on filegroup filegroup_b automatically?

View 1 Replies View Related

Rename Tabs In Excel File Created By SSRS

Nov 13, 2007



I love SQL Server Reporting Services (SSRS), but it doesnt let me name the tabs when exporting to Excel. The feature is well documented as not being available.

So I figured I can use the cell(1,1) on each tab to contain the tab name, and have an SSIS job poll a file share, open the file, read the cell, rename tabs, rename the file, and then email out the file. Polling the directory and emailing is a piece of cake, but I can't find any way to rename a tab without having Excel loaded on the SERVER. Not to mention instantiating an entire instance of Excel on the SERVER every time I want to do this.

I want to leverage SSRS, and preserve the formatting of the excel file, which is why I don't just dump the data in with SSIS to begin with.

Anybody have any ideas?

View 4 Replies View Related

Difference Between Partial Backup (SQL 2005) And File Group Backup

Dec 5, 2006

What is the difference between "Files aned File Groups" backup and Partial Backup?

Looks like both are same.. Please comment.

View 3 Replies View Related

Dynamic File Names For Raw Files Created By Conditional Expressions

Feb 26, 2007

Hello,

I have a huge table of around 6.2 billion rows in Oracle and I need to load this table to SQL Server. I am creating multiple raw files based on contact_dates in the table. I have used conditional expressions to branch out and create raw files. I need to specify static file names for each branch or I have to create multiple variables for each branch and use expressions to create file names.

My intention is to create only 1 variable and evaluate the expression based on the conditional expression description. Is this possible?

Regards

RH




View 4 Replies View Related

Examples Of Certificates Created With Private Key And FROM EXECUTABLE FILE Options

Apr 4, 2006

Hi

I am looking at documentation of CREATE CERTIFICATE statement. I am having hard time in understanding if I want to create CERTIFICATE with above mentioned options, how I am supposed to create either PRIVATE KEY file or EXECUTABLE file. any example would be really helpful for what I am doing here.

thanks

Satya

View 1 Replies View Related







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