SQL Server 2008 :: Can Delete Contents Of Update-cache Folder

Sep 26, 2013

this directory is over 2gb

Program FilesMicrosoft SQL Server100Setup BootstrapUpdate Cache

can you delete the contents safely?

View 1 Replies


ADVERTISEMENT

SQL Server 2008 :: SSIS - Package To Zip Contents Of A Folder Into One ZIP File

Aug 12, 2015

I have a requirement to create a package that takes all files in a given folder and adds them to a single archive (.zip) file. I've tried several methods using 7zip and while I can create archives for every file in the directory I can't seem to get them into a single .zip file.

View 9 Replies View Related

SQL Server 2008 :: Why CDC Returning Insert / Delete When UPDATE A Row In Table

Mar 15, 2013

I am experimenting with using CDC to track user changes in our application database. So far I've done the following:

-- ENABLE CDC ON DV_WRP_TEST
USE dv_wrp_test
GO
EXEC sys.sp_cdc_enable_db
GO

-- ENABLE CDC TRACKING ON THE AVA TABLE IN DV_WRP_TEST
USE dv_wrp_test

[Code] ....

The results shown above are what I expect to see. My problem occurs when I use our application to update the same column in the same table. The vb.net application passes a Table Valued Parameter to a stored procedure which updates the table. Below is the creation script for the stored proc:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

if exists (select * from sysobjects where id = object_id('dbo.spdv_AVAUpdate') and sysstat & 0xf = 4)
drop procedure dbo.spdv_AVAUpdate

[Code] ....

When I look at the results of CDC, instead of operations 3 and 4, I see 1 (DELETE) and 2 (INSERT) for the change that was initiated from the stored procedure:

-- GET CDC RESULTS FOR CHANGES TO AVA TABLE
USE dv_wrp_test
GO
SELECT *
FROM cdc.dbo_AVA_CT
GO

--RESULTS SHOW OPERATION 1 (DELETE) AND 2 (INSERT) INSTEAD OF 3 AND 4
--__$start_lsn__$end_lsn__$seqval__$operation__$update_maskAvaKeyAvaDescAvaArrKeyAvaSAPAppellationID
--0x0031E84F000000740008NULL0x0031E84F00000074000230x02119Test26NULL
--0x0031E84F000000740008NULL0x0031E84F00000074000240x02119Test36NULL
--0x0031E84F00000098000ANULL0x0031E84F00000098000310x0F119Test36NULL
--0x0031E84F00000098000ANULL0x0031E84F00000098000420x0F119Test46NULL

Why this might be happening, and if so, what can be done to correct it? Also, is there any way to get the user id associated with the CDC?

View 7 Replies View Related

SQL Server 2008 :: Find All Transaction (insert / Delete / Update) On A Database For A Day?

May 8, 2015

i would like to know it's possible to find all transaction(insert, delete,update) on a database for a day. if yes what can i do.

View 2 Replies View Related

List The Folder Contents Using SQL

Jun 15, 2004

Hi all,
I have built a Disaster Recovery Site for my DB.on periodic basis, trn files from production server reach DR server and DR setup will apply them locally.

If the flow is smooth then no issues, if one of the file does not reach DR
the entire setup will halt for the want of the file and I dn't have any means to
know which file is missing.

Both my production and DR site located remotely behind firewalls, i.e i can't
physically access the servers or remotely login to the server.

Can anyone tell me how to see the contents in a folder in the server using
SQL query .

Any help is highly appreciated

Thanks and Regards
Srinivas Varanasi

View 4 Replies View Related

Query Hightest Value Contents Of Each Folder?

Jul 20, 2005

Hi,Can anyone tell me how to select the "most recent" date values from agrouped query? Consider the following:CREATE TABLE [dbo].[TestQuery] ( [ID] [int] NOT NULL , [ID_Parent] [int] NOTNULL , [Date] [datetime] NOT NULL ) ON [PRIMARY]This is a simplified adjacency list. What I want to do is find the highestvalued item by date for each sub-tree. In other words, the single highestdate item when This.ID_Parent = That.ID_Parent. I think I first need togroup by ID_Parent, then select the TOP 1 from this query, but how toaggregate them so I get the TOP 1 for each ID_Parent?Thanks for any help you can give me,Robin

View 3 Replies View Related

SQL Server 2008 :: Migrate Contents Of Large Table From One DB To Another?

Mar 3, 2015

I have a large table containing about 800 million rows with an average row length of about 1K. The columns in the table are char columns. I need to move the contents of this table into a similar table where the target columns are varchar. The original table column definitions are compatible with the target table but the reverse is not necessarily true. For example, one column is being changed from int to bigint. The table is partitioned.

So, what is the fastest way to migrate the data. I was thinking to unload each partition into a flat file and load the target table running multiple load streams? Is this a good way?

View 0 Replies View Related

SQL Server 2008 :: List Store Procedures Contents?

Jul 27, 2015

who i can to list the content of all store procedures and funtions in text file ?

View 3 Replies View Related

SQL Server 2008 :: Easy Way To Compare Contents Of Objects Between 2 Different Databases?

Jul 20, 2015

Is there an easy way to compare the contents of objects between 2 different databases? For example, say I had 2 databases, My_DB_1 and My_DB_2, each with a SEC_User table. Say I wanted to do an object-to-object comparison between databases to see if there were any differences. Here's some sample SQL:

use My_DB_1
select * from sys.dm_sql_referencing_entities('dbo.sec_user', 'object')

use My_DB_2
select * from sys.dm_sql_referencing_entities('dbo.sec_user', 'object')

Say that the result sets above both returned a SEC_GetUser sproc object ref. Is there a way to write SQL that will compare the SEC_GetUser sprocs (and other objects in the above rowsets) from both databases? For example, if My_DB_1.SEC_GetUser returns an extra column in the result set than My_DB_2.SEC_GetUser then I'd like my comparison SQL to return a single column "IsDifferent" with SEC_GetUser as a row....

View 1 Replies View Related

SQL Server 2008 :: View Log Cache Size

Jun 21, 2010

Can I view the log cache size in SQL Server memory any DMV's which states that.

View 9 Replies View Related

SQL Server 2008 :: Maintenance Plan Delete History Trying To Delete Wrong Files

Sep 11, 2015

I have some simple files but they are failing because the delete history task is failing as it is looking for files in a non existent directory.

It is looking for files in C:Program FilesMicrosoft SQL ServerMSSQL10_50.INSTANCEMSSQLLog whereas it should be looking in C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLog

how I can get this corrected so I can get the Maintenance Plans to run correctly.

I have tried deleting and recreating the Plan but to no avail

View 0 Replies View Related

SQL Server 2008 :: Identify Size Of Data Cache Allocated From Buffer Pool

Oct 20, 2011

How do i check the size of the datacache allocated from the buffer pool by sql server?

DMV or anything to show me the pool allocation sizes for the various pools in sql server i think i may be able to work from there.

View 9 Replies View Related

SQL Server 2008 :: Hiding The Security Folder From Contractors Using SMSS?

Aug 19, 2015

I am setting up a database for one contractor who needs to access one of our databases but i need to remove the permission for them to view the security folder so he cant access the SA account and enable it. I was able to deny them the view permission to see all the other databases and hide the system objects but i can still see the security folder and the sa account there where i can disable and enable it.

View 9 Replies View Related

SQL Server 2008 :: Changing Alt Snapshot Folder For Merge Replication?

Sep 22, 2015

I have a merge replication. Currently works fine. Publisher & Distributor are on the same server. I need to change the location of the alternate folder for the snapshot files.

I’ll probably just change it through the GUI, but would I use sp_changedistpublisher or sp_changemergepublication if I were scripting everything?

My real concern is the subscribers. Do I have to ‘tell’ the subscribers where the alt folder has been changed to? Do I just run sp_changemergepullsubscription on the subscribers?

View 1 Replies View Related

SQL Server 2008 :: Export Images From Server To A Folder Using SSIS

May 26, 2015

I have table which consists of images. I am trying to export those images to a folder.

declare @path varchar(100)= 'c:images'
SELECT [PICTURE]
,@path+[PICTURE] AS Path
FROM [A].[dbo].[PICTURE]

I am getting this error: The data types varchar and varbinary(max) are incompatible in the add operator.

View 1 Replies View Related

SQL Server 2008 :: Unable To Create Folder If Present Already In A Share Path

Jun 1, 2015

I'm, using my script to many location to create folder to save output files and if the folder is removed/not present it can create it without any noise. But the problem is, while I use the same sort of script to check if a folder is present in the sharedpath it will not create it to copy all bkp files from local to remote path works good, but if you delete the folder or rename the exisitng folder and if the below script tries to create the folder it created as "fILE", very interesting. Per IT team they have given SQL Server account the full rights to create/delete/alter folder/files.

Do I need to use seperate script or way to create / alter folders in the sharepath?

SET NOCOUNT ON
Declare @len INT, @i INT, @Left varchar(max), @right varchar(max), @SERVERNAME sysname,@finalServer sysname
declare @rc int, @dir nvarchar(4000)
DECLARE @cmd1 sysname, @cmd2 sysname, @cmd sysname;
Declare @extPAth varchar(max)

[Code] ....

View 5 Replies View Related

SQL Server 2008 :: Checking Files In A Shared Path If Folder Or File?

Jun 3, 2015

I wrote the below script to print all folders and files located in the share path. How to extend my script to mention by adding another column whether the file is a folder/file , sort of 0 or 1.

declare @chkdirectory1 varchar(4000) = 'shared_pathfolder';
declare @finalserver3 varchar(4000);
create table #tmp (directory_name varchar(4000))
SET @finalserver3 = '''"DIR ' + @chkdirectory1 + ' /B"''';
--select @finalserver3
--SELECT @finalServer
DECLARE @ExecCmd varchar(100)
--SELECT @ExecCmd = 'EXEC master.dbo.xp_cmdshell ' + char(50) + 'mkdir D:'+ CONVERT(varchar(8), getdate(), 112) + '' + char(50)
SET @ExecCmd = 'EXEC master.dbo.xp_cmdshell ' + @finalserver3
--SELECT @ExecCmd
exec(@ExecCmd)
drop table #tmp

View 0 Replies View Related

SQL Server 2008 :: Use Folder Name As Database From Batch File To Execute Files

Jul 17, 2015

I've been struggling with this issue,

1) Test--FolderName (This Test folder name should use as a database name for below sub folders)

a)Create--Sub Foldername
i)create.sql
b)Alter---Sub FolderName
i)Alter.sql
c)Insert---Sub FolderName
i)Insert.sql

[Code] .....

The scripts need to be run in order. So script one needs to run first folder in that sub folders after that next second folders etc..

Is there a way to create a bat file that automatically runs all these scripts, in order against, the databases they need to?

The databases that they need to run against have the name of the database at the beginning of the name of the folder.

View 0 Replies View Related

DB Engine :: Delete All Remote Table Contents

Jun 24, 2015

I'm copying date from a  sql server 2000 table to a sql server 2008 R2 table using a Linked Server.I need to be sure the remote table is correct before processing it.I first delete all the remote table contents and after that, I insert into remote_table from local_tableWhat happens if the communication is interrupted during the insert?I mean, Can I be sure all records were copied just checking if record count > 0 ?

View 3 Replies View Related

SQL Server 2008 :: Create All Procedures Located In A Folder One By One And Saving Output File

May 15, 2015

I am asked to create 100 procedures to a database. Any best way to create them in a database one by one by calling the files and saving the execution output files in a folder?

View 9 Replies View Related

SQL Server 2008 :: Is Only One Plan Is Kept For One Query In Plan Cache

Mar 14, 2015

Is only one plan is kept for one query in plan cache?

i heard generally hash is created for a query and plan is search with this hash.

View 2 Replies View Related

SQL Server 2008 :: Update Null Enabled Field Without Interfering With Rest Of INSERT / UPDATE

Apr 16, 2015

If I have a table with 1 or more Nullable fields and I want to make sure that when an INSERT or UPDATE occurs and one or more of these fields are left to NULL either explicitly or implicitly is there I can set these to non-null values without interfering with the INSERT or UPDATE in as far as the other fields in the table?

EXAMPLE:

CREATE TABLE dbo.MYTABLE(
ID NUMERIC(18,0) IDENTITY(1,1) NOT NULL,
FirstName VARCHAR(50) NULL,
LastName VARCHAR(50) NULL,

[Code] ....

If an INSERT looks like any of the following what can I do to change the NULL being assigned to DateAdded to a real date, preferable the value of GetDate() at the time of the insert? I've heard of INSTEAD of Triggers but I'm not trying tto over rise the entire INSERT or update just the on (maybe 2) fields that are being left as null or explicitly set to null. The same would apply for any UPDATE where DateModified is not specified or explicitly set to NULL. I would want to change it so that DateModified is not null on any UPDATE.

INSERT INTO dbo.MYTABLE( FirstName, LastName, DateAdded)
VALUES('John','Smith',NULL)

INSERT INTO dbo.MYTABLE( FirstName, LastName)
VALUES('John','Smith')

INSERT INTO dbo.MYTABLE( FirstName, LastName, DateAdded)
SELECT FirstName, LastName, NULL
FROM MYOTHERTABLE

View 9 Replies View Related

Sys.dm_os_memory_cache_counters Vs. SQL Server:Plan Cache Cache

Feb 15, 2008

Hi guys,

I am looking at the plan caches/cached pages from the perspective of
sys.dm_os_memory_cache_counters and sql serverlan Cache - Cache Pages

For the first one I am using

select (sum(single_pages_kb) + sum(multi_pages_kb) )
from sys.dm_os_memory_cache_counters
where type = 'CACHESTORE_SQLCP' or type = 'CACHESTORE_OBJCP'
a slight change from a query in
http://blogs.msdn.com/sqlprogrammability/

For the second just perfmon.

The first one gives me a count of about 670,000 pages only for the object and query cache and the second one gives me a total of about 100,000 pages for five type of caches including object and query.

If I am using the query from http://blogs.msdn.com/sqlprogrammability/ to determin the plan cache size

select (sum(single_pages_kb) + sum(multi_pages_kb) ) * 8 / (1024.0 * 1024.0) as plan_cache_in_GB
from sys.dm_os_memory_cache_counters
where type = 'CACHESTORE_SQLCP' or type = 'CACHESTORE_OBJCP'

it gives me about 5 GB when in fact my SQL Server it can access only max 2GB with Total and Target Server Memory at about 1.5 GB.

Does anyone have any idea what is going on?

View 2 Replies View Related

RS Webservice Delete Folder

Apr 21, 2008



Hi,

Is there any way to delete folder in reportserver using RS webservice API?
I know there is a method: DeleteItem ( Item As string )
But I tried it and it didn't work for folders.
Thanks


JY

View 1 Replies View Related

SQL Server 2008 :: MERGE And Delete From Target

Mar 12, 2015

I'm not even sure this is possible but I'm using MERGE in a process that has 3 source tables (the process steps through each source table sequentially) and I need to delete from the Target database occasionally.

My current code is

sqlMerge = "MERGE " + TableName + " AS target USING @CData AS source" +
" ON target.TotRsp = source.TotRsp AND target.ClientRef = source.ClientRef AND target.dbPatID = source.dbPatID" +
" WHEN MATCHED THEN" +
" UPDATE SET dbPatFirstName = source.dbPatFirstName, dbPatLastName = source.dbPatLastName,

[Code] ....

The Target db data is made up from several different clients and when the MERGE runs it uses TotRsp, ClientRef and dbPatID to uniquely match a source row to the target row and if no match it inserts the source row.

My problem is that when this runs with Source A first, it will delete all merged data from Source B & C. Then when Source B runs it will insert all Source B data but delete all from A & C and so on.

Is there way that that I can include additional clauses into NOT MATCHED BY SOURCE THEN so it knows only to delete when data has come from say Source A. Once the data is in the target table there is no reference to which source table it came from tho.

If there isn't a solution I suppose I could always add an extra column to the target db to indicate which source it came from and then have something like

NOT MATCHED BY SOURCE AND t.Source = 'SourceA'.

That's quite a bit of work my end to do that tho so I'd like to be sure it works.

View 1 Replies View Related

SQL Server 2008 :: Use Top N For Select / Delete In A While Loop?

Jul 27, 2015

Can I safely use top n select/delete in a while loop? For example:

declare @FieldVal int
while (select count(*) from @MyTempTable) > 0
begin
select top 1 @FieldVal = FieldVal from @MyTempTable
-- process @FieldVal then delete the row
delete top 1 from @MyTempTable
end

I like the simplicity of the above approach as long as it's reliable and there aren't any gotchas that I may not be aware of.

View 9 Replies View Related

SQL Server 2008 :: Delete Before Insert Trigger Statement

Apr 6, 2015

What statement do I use, as part of an insert trigger, to insert xml data from the xml database to a flat file database, to check if a record with a specific ID exists to delete first then insert the changed record, instead of adding the changes or an updated from the original xml database.

What I’m trying to do is take the xml formatted data out of one sql server database and insert the data only in that xml into a another sql database. So I can play with the data.

Problem is if the data in the xml is updated or changed for a specific record on the original xml database then the trigger inserts another copy into the created database (which I don’t want).

This is on SQL Server 2008R2.

View 2 Replies View Related

SQL Server 2008 :: Job To Delete All Records Then Copy All From Another Table?

Apr 22, 2015

I am using a SQL Server Agent jobs that run each morning to update the records in a table to match what they should be for that day. I built them and tested it using a test table called "testtable1". It worked fine. But when I switched over to our production table, it fails saying the table has to be decaled. What would be the difference. The production table has a "@" in front of the name, is that causing issues?

USE [Live_build]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
BEGIN
DELETE
FROM @ZIPLIST
INSERT INTO @ZIPLIST
SELECT * FROM tblZip3DSWed;
END

View 4 Replies View Related

SQL Server 2008 :: Delete Duplicate Rows From ANY Table

Jul 31, 2015

Is there is 'fairly' simple query to delete duplicate rows from ANY table ?

A script which removes duplicates from a table, when a table_name is supplied.

View 9 Replies View Related

Checking Contents Of Column And Replacing Contents If First Character Is A Letter

Jun 25, 2007

Hi All,I have come up against a wall which i cannot get over.I have an sql db where the date column is set as a varchar (i know, should have used datetime but this was done before my time and i've got to work with what is there). The majority of values are in the format dd/mm/yyyy. However, some values contain the word 'various'.I'm attempting to compare the date chosen on a c# .net page with the values in the db and also return all the 'various' values as well.I have accomplished casting the varchar to a datetime and then comparing to the selected date on the .net page. However, it errors when it comes across the 'various' entrant.Is there anyway to carry out a select statement comparing the start_date values in the db to the selected date on the .net page and also pull out all 'various' entrants at the same time without it erroring? i thought about replacing the 'various' to a date like '01/01/2010' so it doesn't stumble over the none recognised format, but am unsure of how to do it.This is how far i have got: casting the varchar column to datetime and comparing.  SELECT * FROM table1 WHERE Cast(SUBSTRING(Start_Date,4,2) + '/' + SUBSTRING(Start_Date,1,2) + '/' +SUBSTRING(Start_Date,7,4) as datetime)  '" + date + "'"Many thanks in advance! 

View 7 Replies View Related

Delete Old Reports Saved In Shared Folder

Nov 16, 2007



Hi All,

I subsricbe few reports by data driven file shared method. Each reports is supposed to be delivered to 5 different customers. But each customer can see only his/her data. So I use a paramter to generate 5 different reports for each customer. But once the five different reports are saved in the shared file folder, is there any method to delete old files? These reports are to be executed once a week

Thanks

View 2 Replies View Related

SQL Server 2008 :: Restoring Database - Delete Data From Partitions

Feb 20, 2015

I am restoring a database with 10yrs worth of data which have monthly partitions but i would like to keep only 5yrs of data after the restore is done, what is the best/faster approach to delete the 5yrs data without deleting the partitions as that may cause the db in accessible.

View 9 Replies View Related

SQL Server 2008 :: How To Delete Or Drop Index To Free Up Space

May 31, 2015

I am new to mssql server. There is a table on one of my databases that occupies a lot of space. And the space usage is as follows: (all values in KB)

reserved: 42329064
data: 16272288
index: 26050032
unused: 6744

This table takes up almost 80% of my database size, and the information is this table just captures the time spent by a user on the website(not very critical data)

I would like to know how to delete the entire index (which is what is occupying most space) to free up disk space. the index is a clustered index.

View 3 Replies View Related







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