Trigger That Creates Folder

Jan 18, 2005

Does anyone know if it is possible (and if yes, how) to create a trigger that creates a folder for every inserted record?
In a specific root folder, I want a subfolder for every record in the table. How does the trigger have to look like to make the folder automatically with every insert of a new record???

thanks!!

View 3 Replies


ADVERTISEMENT

64Bit - Creates Program Files Folder - Why?

Aug 30, 2007

We noticed SQL Server 2005 is creating Program FilesCommon FilesMicrosoft SharedDW on our largest drive for each 64-bit installation. Does anyone know what this is? It appears there is no Microsoft documentation regarding this installation and if we need to keep it. It may be .NET related, but I have no idea why it is needed.

Dave

View 5 Replies View Related

Trigger Isn't Showing In Folder!

Nov 14, 2006

Hi,

I selected create trigger from the tables pop up menu.

I created a trigger for the dbo.sysjobhistory table in the msdb database.

When I click the parse icon it comes back with success.

When I check the trigger folder under the sysjobhistory table the the trigger is not there.

What am I doing wrong?

FYI, here is the trigger code:

CREATE TRIGGER dbo.email_on_job_fail_INSERT
ON dbo.sysjobhistory

FOR INSERT
AS

IF EXISTS (SELECT run_status FROM inserted WHERE run_status = 0 )

BEGIN

DECLARE @cmd VARCHAR(1200)

SET @cmd = (SELECT step_id, step_name, sql_message_id, run_date, run_time, server, message FROM inserted WHERE run_status = 0)

EXEC master.dbo.xp_sendmail
@recipients = 'peterd@bluewolfgroup.com;kashifm@bluewolfgroup.com',
@subject = 'Server Job Failed',
@query = @cmd;

END
GO

Your input is greatly appreciated!

pfd













View 4 Replies View Related

New To Triggers - Deleted Folder Trigger

Jul 4, 2006

Hi

I would like to know how can I write a trigger for a table that lists folders deleted. I have a table called RECORDS which contains folders and would like to know folders that are being deleted.

Thanks...

View 8 Replies View Related

T-SQL (SS2K8) :: Trigger To Call A Program To Write Text File Onto A Folder In Server

Apr 29, 2014

I have created a trigger to call a program that is written by our program. The program is basically read the record in the table and write to a text file, then delete the record from the table.

The trigger is a after insert trigger. After we added the trigger, we insert a record to the table. The result is that the record still and did not get deleted. Also, the text file didn't get created either. It seems that it take a long time for the record to be written to the table.

But if we just run the program (a exe file), it can write a text file in the folder and delete the record. the trigger is basically:

USE [Zinter]
GO
/****** Object: Trigger [dbo].[ZinterProcess] Script Date: 04/29/2014 18:34:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

[Code] ....

View 9 Replies View Related

Unable To Copy App_data Folder Databases On Production Server To A Different Folder Or Location

Sep 19, 2007

I dont alot about sql server 2005(Express edition). For debugging purposes i want to copy  the whole app_data folder(.mdf & .log files) on the production server to another folder on the same machine(or sometimes to a network folder).  So when i copy and try to paste this App_data folder to a new location, i get this error message
"cannot copy ASPNETDB: it is being used by another person or program. close any programs that might be using the file and try again."
After reading the above message, i close visual web developer, stop the website in IIS and stop the SQLExpress service on the server and try again but still get the same message.
So how can i make sure that all the programs accessing these database files are closed such that i'm able able to copy them to a different location.

View 2 Replies View Related

Integration Services :: SSIS WMI Event Watcher Check For New Folder In Existing Folder

Jul 2, 2015

I know a WMI event watcher can be used to watch for a new file being added to a folder. However, I need to check for new folders being added to an existing folder. I haven't been able to find a post on doing this. Is there a way in WQL to check for a new folder being added instead of a new file? I've used SQL for years, but am new to SSIS.

View 2 Replies View Related

SSIS Or SQl Agent Job Moving From A Network Folder To A Sharepoint Folder - Errors...

Oct 31, 2007



Ok,

I have a network folder called A

I have a SharePoint (2007) Document Library site called B. Web Client is enabled on the server and B is mapped as a Drive (let's call it Y for this discussion)

I want to move documents in A to B. Easy enough, right? Not so....

I first started by creating a batch file that issues a COPY \A \Y /Y at the command prompt. Viola! Worked Great!

I then moved that command to a SQL Agent job as a CMDExec statement (exact same statement) and attempted to run it.....CRASH! It found the files in A but then said "The system cannot find the path specified"

Ok, so I tried it in SSIS. CRASH! Checked the error log. Same thing...

So I then checked the account under which the SQl Agent was running (special domain account for all our SQL Servers). Thinking it might mater I changed it to run under my name (I'm in Domain admin). I also ensured I had permissions to the SPS 2007 library as well. (I did).

Ran again! CRASH! Same error....

So, I created a batch file , placed thec ommand in the batch file and ran that from the command prompt! Viola! Worked Great.

So, I was thinking of how ingenious I was as I pasted my C:RootCopy.bat into my SQL Agent job. With a big grin on my face I right clicked and picked "Start Job at step".......CRASH! Same error.

Does anyone have any ideas on this ???????????????

Thanks,
Stephen

View 3 Replies View Related

Can I Use The Foreach Loop To Obtain The Sub Folder Names Within A Folder?

Sep 4, 2006

I have a set of folders with the following structure:

MainFolder

1999

SpreadsheetA.xls

SpreadsheetB.xls

SpreadsheetC.xls

2000

SpreadsheetA.xls

SpreadsheetB.xls

SpreadsheetC.xls

etc.

Is there a way that I can use the foreach loop container to loop the sub folders? My plan was to get the folder name and path into a variable, use this to build the connection string for each file in this folder, carry out the upload for that folder, then move onto the next folder and do the same thing, but I cannot see a way to do this.

Thanks,

Sam

View 2 Replies View Related

Moving Csv File From One Folder To Another Folder

Mar 28, 2008

I am having problem with moving a file from one folder to another folder. Here is the detailed scenario:

I want to move a input.csv file from shared input folder to shared archive folder. i am using the below code to do this.
declare @inpath varchar(100)
SET @inpath = 'move "\abcdefINPUTinput*.csv" "\abcdefARCHIVEarchive.csv"'
EXEC @filestatus = master..xp_cmdshell @inpath
but the problem was it was cutting the input.csv file from INPUT folder but not pasting it in the ARCHIVE folder.
I really appreciate if anyone can help me to solve this or anyone can tell some workarounds.

Thanks,

View 20 Replies View Related

Insert Into Creates Two Identical Rows

Mar 13, 2008

I have an "insert into" statement that creates two identical rows in a table, with this statement:
delete from [table] where [column] = @parameterINSERT INTO [table]([fields]) VALUES ([parameter values])
This is the code-behind that performs the insert:
Dim dbConn As New SqlConnection(strConn)Dim cmd As New SqlCommand("sp_CreateUser", dbConn)cmd.CommandType = Data.CommandType.StoredProcedurecmd.Parameters.AddWithValue("@UserID", strUserID)cmd.Parameters.AddWithValue("@UserName", strUserName)cmd.Parameters.AddWithValue("@Email", strEmail)cmd.Parameters.AddWithValue("@FirstName", strFirstName)cmd.Parameters.AddWithValue("@LastName", strLastName)cmd.Parameters.AddWithValue("@Teacher", strTeacher)cmd.Parameters.AddWithValue("@GradYr", lngGradYr)Using dbConndbConn.Open()cmd.ExecuteNonQuery()dbConn.Close()cmd.Dispose()dbConn.Dispose()End Using
I wonder if it inserts twice due to a postback issue. Is there a way to stop two rows from being created in the first place with the same "insert into" statement? I'd appreciate any advice.

View 3 Replies View Related

Upsizing Creates Huge MSSQL

Feb 1, 2005

I am upgrading a .mdb to MSSQL. The .mdb is 17MB, but the resulting MSSQL is 72MB. Tried using both the Access Upsizing Wizard and Enterprise Manager DTS. I have done this a number of times before, but never ran into this problem. Any ideas what coule be going on, and how to fix it?

View 2 Replies View Related

Upsizing Creates Huge MSSQL

Feb 1, 2005

I am upgrading a .mdb to MSSQL. The .mdb is 17MB, but the resulting MSSQL is 72MB. Tried using both the Access Upsizing Wizard and Enterprise Manager DTS. I have done this a number of times before, but never ran into this problem. Any ideas what coule be going on, and how to fix it?

View 1 Replies View Related

A Function That Creates A View (dynamic SQL)

Jan 23, 2008

I'm very new to SQL Server. Please help. I need to create a FUNCTION that creates a view. Then call this function in a SQL which is passed as a parameter to BCP. In Oracle, it would be something like:



create function CREATEVIEW

return number as

begin

create view SampleView as SELECT a,b,c from Mytable;

return 1;

when others then return 0; -- for exception handling

end:



create function DROPVIEW

return number as

begin

Drop view SampleView;

return 1;

when others then return 0; -- for exception handling

end:



Then my BCP will have something like:



BCP "select CREATEVIEW from dual"... QUERYOUT ..



then

BCP "select * from SampleView"... QUERYOUT ..



then drop the view again:

BCP "select DROPVIEW from dual"... QUERYOUT ..



I know there is no DUAL table in SQL SERVER. I just want to know how to code this in SQL Server.

The origin of my problem is that my SQL statement is too long to fit as BCP parameter, hence, am creating a view and reading there and dropping it again. If you can provide me with a better workaround, that would be great.
Thanks in advance.

View 7 Replies View Related

SSIS Creates SQL DUMP File

Mar 22, 2007

I have several SSIS packages which are run in sequence. But some strange reason sometimes a SQL Dump is created. If I restore database and restart the same ETL is works, or it creates another SQL Dump in a different place. Any idea on how to debug this problem?

SQL Server 2005 Developer Edition SP1 ( should I upgrade to SP2? )
Windows 2003/r2 64b ( latest patches )

Eventlog
Bucket 09193120, bucket table 5, EventType sql90exception64, P1 dtsdebughost.exe, P2 2005.90.1399.0, P3 0000000043500d1e, P4 ntdll.dll, P5 5.2.3790.1830, P6 0000000042438b79, P7 0, P8 000000000003d5a8, P9 0000000000000000, P10 NIL.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

SQL Dump file
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Input parameters: 4 supplied
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ProcessID = 5928
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ThreadId = 0
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Flags = 0x0
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, MiniDumpFlags = 0x0
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, SqlInfoPtr = 0x000000000100FAF8
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, DumpDir = <NULL>
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ExceptionRecordPtr = 0x0000000000000000
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ContextPtr = 0x0000000000000000
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ExtraFile = <NULL>
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, InstanceName = <NULL>
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, ServiceName = <NULL>
03/21/07 17:55:11, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Callback type 11 not used
03/21/07 17:55:12, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, Callback type 7 not used
03/21/07 17:55:12, ACTION, SQLDUMPER_UNKNOWN_APP.EXE, MiniDump completed: C:Program FilesMicrosoft SQL Server90SharedErrorDumpsSQLDmpr0053.mdmp
03/21/07 17:55:12, ACTION, DtsDebugHost.exe, Watson Invoke: Yes
03/21/07 17:55:12, ACTION, DtsDebugHost.exe, Watson Invoked: C:PROGRA~1COMMON~1MICROS~1DWDW20.EXE dw20.exe -d "C:Program FilesMicrosoft SQL Server90SharedErrorDumpsSQLDmpr0001.mft"

Versions

Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework Version 2.0.50727

Installed Edition: IDE Standard
Microsoft Visual Studio 2005 Premier Partner Edition - ENU Service Pack 1 (KB926601)
This service pack is for Microsoft Visual Studio 2005 Premier Partner Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/926601

SQL Server Analysis Services Microsoft SQL Server Analysis Services Designer Version 9.00.2047.00
SQL Server Integration Services Microsoft SQL Server Integration Services Designer Version 9.00.2047.00
SQL Server Reporting Services Microsoft SQL Server Reporting Services Designers Version 9.00.2047.00

View 3 Replies View Related

Sql Stored Procedure - Proc Creates Query

Jan 11, 2007

Is it possible to pass 5 variables to a proc and have IT do the thinking and query structuring?
An example of what I'm try to do is have one proc for getting vehicles by make, model, and years
example of what I'd like to accomplish:veh_list_vehicleInfo_byDetails
@TypeID int,
@MakeID int,
@ModelID int,
@begYear int,
@endYear int
AS
BEGIN

declare @SQL as nvarchar(500)
set @SQL = 'SELECT a.ID, b.Model, c.Make, d.Name, a.Year, a.Mileage, a.Price, a.Sale, a.Certified_Pre_Owned FROM veh_vehicles a INNER JOIN veh_model b ON a.ModelID = b.ID INNER JOIN veh_make c ON a.MakeID = c.ID INNER JOIN veh_location d ON a.LocationID = d.ID'

decalre @ATTRIBUTES as nvarchar(500)
if @TypeID is not null AND @TypeID > 0
begin
set @ATTRIBUTES = @ATTRIBUTES + ' a.TypeID = ' + @TypeID
end
if @MakeID is not null AND @MakeID > 0
begin
set @ATTRIBUTES = @ATTRIBUTES + ' a.MakeID = ' + @MakeID
end

....etc etc.......

if Len(@ATTRIBUTES) > 0
begin
EXEC(@SQL + ' WHERE ' + @ATTRIBUTES)
End
Else
BEGIN
EXEC(@SQL)
END

END
 But I keep getting some errors regarding converting 'a.TypeID = ' to int
?????  Please help!!
 I figured this would be easier than writing stored procs for EACH situation

View 2 Replies View Related

Executing Dts Package Through Asp.net Creates Tables But No Data!

Sep 25, 2007

hey out there,
just started playing with this so bare with me...
i've used the data export wizard to create a dts package in sql server 2000. the package takes selected tables, creates an access database and then dumps all the data into the tables.
it works fine when i run the package in enterprise manager, but when i call it from asp.net (vb.net) the access database gets created, the tables are created but it fails to dump the data!
this is my code:1 Public Sub executeDts()
2
3 Dim oPkg As DTS.Package2
4 oPkg = New DTS.Package2
5 Dim oStep As DTS.Step
6 Dim sMessage As New StringBuilder
7
8
9 oPkg.LoadFromSQLServer("serverNameHere", "userNameHere", "passwordHere", DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, , , , "packageNameHere")
10
11 For Each oStep In oPkg.Steps
12
13 sMessage.Append("<p> Step [" & oStep.Name & "] ")
14
15 If oStep.ExecutionResult = DTSStepExecResult.DTSStepExecResult_Failure Then
16
17 sMessage.Append(" failed<br>")
18
19 Else
20
21 sMessage.Append(" succeeded<br>")
22
23 End If
24
25 sMessage.Append("Task """ & oPkg.Tasks.Item(oStep.TaskName).Description & """</p>")
26
27 Next
28
29 Response.Write("sMessage = " & sMessage.ToString & "<br/>")
30
31 oPkg.Execute()
32
33 oPkg.UnInitialize()
34
35 oPkg = Nothing
36
37 End Sub
38

am i missing a step?! it seems very odd that the tables are created but the insert fails...
any advice anyone can offer would be great!
cheers,
jake

View 2 Replies View Related

CHange Of Server Name Creates Agent Problem

May 30, 2002

Hi.
I've installed and configured a SQL Server 2000 box on our local network. Now that I've moved it up to the Live network I've had to change it's name and IP.
Everything is fine apart from the SQL Server Agent, specifically the maintenance plans and jobs.
When I go to change or delete the existing plans or jobs I have the following message:
Microsoft SQL-DMO (ODBC SQL State: 42000)
Error 14274: Cannot add, update or delete a job (or it's steps or schedule) that originated from an MSX Server.

In typical MS style, I have actually been able to delete the maintenance plans from the "Maintenance Plans" area and create new ones. However I am unable to delete the related jobs under the SQL Server Agent - Jobs menu.

As far as I'm aware I have never added a Master SQL Agent Server (MSX) and looknig under the Agent properties - Job System it does say (none).

Any help very much appreciated.

Simon Call

View 1 Replies View Related

.Update Creates New Record But All Fields Null

Jan 26, 2006

Hi guys, I have made several Access-based CMSs but now I am using SQL Server. I can read the records but my first attempts at writing are resulting in new records (with new ID) but all the fields are null.
I am posting the data from a form to the same page and an if /then statement catches the flag in the URL and runs the update script below. All the field names are correct.
if request.QueryString("add")<> "" then
Dim rsUpdateEntry
Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")
rsUpdateEntry.Open "SELECT * from generic_country_info" , oConn, 2, 3

rsUpdateEntry.AddNew

rsUpdateEntry.Fields("title1") = Request.Form("title1")
rsUpdateEntry.Fields("body1") = Request.Form("body1")
rsUpdateEntry.Fields("title2") = Request.Form("title2")
rsUpdateEntry.Fields("body2") = Request.Form("body2")
rsUpdateEntry.Fields("title3") = Request.Form("title3")
rsUpdateEntry.Fields("body3") = Request.Form("body3")
rsUpdateEntry.Fields("title4") = Request.Form("title4")
rsUpdateEntry.Fields("body4") = Request.Form("body4")
rsUpdateEntry.Fields("title5") = Request.Form("title5")
rsUpdateEntry.Fields("body5") = Request.Form("body5")
rsUpdateEntry.Fields("image1") = Request.Form("attach1")
rsUpdateEntry.Fields("image2") = Request.Form("attach2")
rsUpdateEntry.Fields("image3") = Request.Form("attach3")
rsUpdateEntry.Fields("image4") = Request.Form("attach4")
rsUpdateEntry.Fields("image5") = Request.Form("attach5")
rsUpdateEntry.Fields("country") = Request.Form("country")
rsUpdateEntry.Fields("dest_url") = Request.Form("dest_url")


rsUpdateEntry.Update

rsUpdateEntry.Close
Set rsUpdateEntry = Nothing
end if
Thanks
Mark

View 1 Replies View Related

Database Script Creates Huge Log File

Mar 20, 2008

I am creating a database for an application through script. After the tables, views, and sp's are created, the database is populated with data. After all of this (and before the application is even run), the log file is about 700MB. If I shrink the database, it takes the log down to 1MB. The mdf file is about 165 MB before and after it has been shrunk.

I have two questions:
1. Is there something I should look for in my database scripts or is there a setting that could prevent this from being created so large.

2. Is there a script I can run in my sql code after the database has been created and populated to shrink it.

Thank you for your help

View 2 Replies View Related

Dynamic T-SQL Query Creates Table At Run Time.

Aug 1, 2007

The following are the output lines from my code which is constructing some T-SQL queries on the fly. The query highlighted in yellow is the problem query. The code upto the problem query is working correctly and I am able to see the output tables in the Query Analyzer


STEP 1 : Create 3 Tables In Dynamic T-SQL : Showing 3 Strings from Exec statement

Create Table ##Test_word28July2007185548990201 ( t float, e float, s float, word varchar(80) )
Create Table ##OUT_Test_word28July2007185548990201 ( t float, e float, s float, word varchar(80), KeywordID int, rank float )
Create Table ##STVR_FLOAT_Test_word28July2007185548990201 ( var_val float)


Step 2: Retrieving A Value Into Another Global Table (table has only 1 row and 1 column)
Insert Into ##STVR_FLOAT_Test_word28July2007185548990201 ( var_val ) Select IsNull( t , 0 ) from ##Test_word28July2007185548990201
(1 row(s) affected)

Step 3: I need the value (var_val) in ##STVR_FLOAT_Test_word28July2007185548990201
Update ##Out_Test_word28July2007194827580759 Set t = Select var_val from ##STVR_FLOAT_Test_word28July2007194827580759 where t > Select var_val from ##STVR_FLOAT_Test_word28July2007194827580759
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'Select'.
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'Select'.
(1 row(s) affected)



Problem Definition

Part 1

The update query is trying to retrieve a value in a dynamically constructed table. ##STVR_FLOAT_Test_word28July2007185548990201 (1 column var_val , 1 row)

Update <Table_Name> set t = @var_val where t > @var_val
The update query is simple, except I need to "SELECT" @var_val from the dynamic table


The @var_val is a float value.

I have outputted the contents of the table that is holding the @temp_val variable
It has the correct value and the table has only 1 row and 1 column.

WHAT IS THE SYNTAX OF A QUERY TO SELECT A SINGLE VALUE FROM A TEMP TABLE WITH ONLY 1 ROW OR COLUMN AND USE THE SELECTED VALUE AS A VARIABLE IN AN UPDATE STATEMENT

View 5 Replies View Related

Stored Procedure That Creates A View In Another Database

Apr 18, 2008

Hi,

I want to run a stored procedure in Database A that will create a View on a table in database B. Is that possible?


Example (Creating a Stored Procedure in Database A):

create procedure test
as
begin

use B
create view Vjobs
as
select * from jobs
end


This does not work because you are not allowed "USE" in a Stored Procedure.

Please help.

View 1 Replies View Related

Exporting Reports Creates A Blank Window

Nov 15, 2006

I have created a few reports and linked them to a URL on a web page. (sample link is : http://servername/ReportServer/Pages/ReportViewer.aspx?%2fMy_Reports%2fBacklog+Report&rs:Command=Render )

When the user clicks on the link above it renders correctly but when the user tries to export the report to any format on the list, it launches another window with the following URL : http://servername/ReportServer/Reserved.ReportViewerWebControl.axd?ExecutionID=czq4c355dmsxdy55dif1nm55&ControlID=ad74d68e-2a9c-430f-8655-dd0e6c46f831&Culture=1033&UICulture=9&ReportStack=1&OpType=Export&FileName=Backlog+Report&ContentDisposition=OnlyHtmlInline&Format=EXCEL

which then prompts the user to Open or Save the report.

How do I stop this window from opening ? or how can I make it close automatically ?

Please advise.

I know if I can change the ContentDisposition somehow to AlwaysInline then this extra window will not show during the export but it keeps defaulting to OnlyHTMLInline for ContentDisposition.

Thanks in advance.

AL

View 2 Replies View Related

Turkish Character I Creates Problem In My Query

Oct 9, 2006

Dear all,

i am using SQL server for turkish language and i have a problem with turkish character "i". Whenever "i" comes in any word of query it gives wrong result. It also not able to recognize the small and capital "i" of turkish.

View 1 Replies View Related

Using CREATE TABLE DDL On Excel Creates Two Tables

Mar 11, 2008

Hello. I am using OLEDB 4.0 to create an excel file and store DataTable rows into it. I am using

CREATE TABLE [SheetName] ([Column1] longtext, [Column2] longtext....

DDL and then write data using INSERT INTO ... DDL.

There are three strange things that i've encountered and will be glad to get help from anyone:



If I use as a table name expression with spaces, the name is changed to expression with underscore '_' symbol instead of spaces.
I can not set trailing '$' when creating a table, but when inserting data I have to use the name with traling '$' otherwise the exception is thrown. Moreover, if i get the scheme of the Excel file later I am getting TWO tables instead of one: a first with the name without '$' and another the same with trailing '$'. Nedless to say that visually Excel shows only a name without '$'
If I am trying to do same operations using OLEDB 12.0 (Office2007) I get invalid file.
If anyone knows how I can overcome above issues, please write me a code. I am coding in C# but VB examples are as good as any other.

View 5 Replies View Related

Compact Edition Creates Too Many DB's And Doesn't Save To The Original

Apr 22, 2008



So i am trying to make a simple database and with one table and use a gui to make rows.
When i run the program in debug mode it creates a new copy of my DB in the debug folder and saves only their, i cannot find a way to save back to the original DB no matter what i do including changing the Copy to Output Directory.

Now the more i try to fix this the more new DB it creates one in the Release Folder, one in the bin/Debug/bin/Debug
one in bin/Release/bin/Release.

I am going crazy trying to scoure the entire project looking for someplace i can fix this.

All i want is to create a DB and be able to make changes to it and only it.

Does anyone have any solutions to this?

Thank you for your time

View 2 Replies View Related

Transact SQL :: Script That Creates User Mapping For Network Service

Aug 20, 2015

SQL script that creates a User Mapping for NT AUTHORITYNETWORK SERVICE to a database?

View 3 Replies View Related

Script Destination Component Code Sample Here That Creates A Csv Or Xml File

Jul 11, 2006

After much work and thanks to all of you who helped on this here is a code sample that can be adapted. From the dataflow task add an OLEDB source component, a row count component and finally a Script Destination Component.

On the Script Destination Component rename the Input node of the imports and outputs tree view to "ParsedInput"

The readonly User: variables that start with gs can be read in the PreExecute method

The readwrite User: variable giSuccessCount can only be used in the post execute task because it is populated by the Row Count Component which is the previous object in the Dataflow

The xml code is adapted from an idea in Donald Farmers book

enjoy

Dave

Now if someone can make a Script Source Component that can read a file with a header , data body and trailer that would b egreat!
' Microsoft SQL Server Integration Services user script component
' This is your new script component in Microsoft Visual Basic .NET
' ScriptMain is the entrypoint class for script components
 
Imports System
Imports System.Data
Imports System.Math
Imports System.IO
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.Xml
 
Public Class ScriptMain
    Inherits UserComponent
    Dim sw As StreamWriter
    'In addition to using the Imports System.Xml statement a reference must be added to the
    'System.Xml assembly  (Select Project-Add Reference from IDE)
    Dim xWriter As XmlTextWriter
    Dim OutputFileType As String '.csv or .xml
 
 
 
    Public Overrides Sub PreExecute()
       
        'Read Only variables
        Dim gsPickUp As String = Me.Variables.gsPickUp 'D:ftprootOutAvid'
        Dim gsPickUpFilename As String = Me.Variables.gsPickUpFilename '1_AVID_'
        Dim gsPickUpFileExtn As String = Me.Variables.gsPickUpFileExtn '.csv'
        Dim gsMemoText As String = Me.Variables.gsMemoText 'Memo Text : credit adjustment'
        Dim gsStatementText As String = Me.Variables.gsStatementText 'Statment Text : credit adjustment'
        Dim gsRunMode As String = Me.Variables.gsRunMode 'UPDATE'
        Dim fileName As String = gsPickUp & "" & gsPickUpFilename
        fileName = fileName & (Format(Now(), "yyMMdd").ToString)
        'MsgBox(fileName)
 
        OutputFileType = gsPickUpFileExtn
        If OutputFileType = ".csv" Then
            fileName = fileName & gsPickUpFileExtn
            sw = New StreamWriter(fileName) 'connection to dest file
 
            'Header records
            sw.Write(gsRunMode)
            sw.Write(Environment.NewLine) ' end of line
            sw.Write(gsMemoText)
            sw.Write(Environment.NewLine)
            sw.Write(gsStatementText)
            sw.Write(Environment.NewLine)
            sw.Write(Environment.NewLine) 'Spacer
        End If
 
        If OutputFileType = ".xml" Then
            fileName = fileName & gsPickUpFileExtn
            'xWriter = New XmlTextWriter(Me.Connections.XMLConnection.ConnectionString, Nothing)
            'xWriter.WriteStartDocument()
            'xWriter.WriteComment("Customer file parsed using script")
            'xWriter.WriteStartElement("x", "customer", "http://some.org/name")
            'xWriter.WriteAttributeString("FileName", Me.Connections.XMLConnection.ConnectionString)
            xWriter = New XmlTextWriter(fileName, Nothing)
            xWriter.WriteStartDocument()
            xWriter.WriteComment("Customer file parsed using script")
            xWriter.WriteStartElement("x", "customer", "http://some.org/name")
            xWriter.WriteAttributeString("FileName", fileName)
        End If
 
 
    End Sub
 
 
 
    Public Overrides Sub ParsedInput_ProcessInputRow(ByVal Row As ParsedInputBuffer)
 
 
        If OutputFileType = ".csv" Then
            Dim delim As String = ","
 
            sw.Write(Row.ProjectID.ToString + delim)
            sw.Write(Row.TransactionRefNum.ToString + delim)
            sw.Write(Row.CustomerNum.ToString + delim)
            sw.Write(Row.AccountNum.ToString + delim)
                         
            sw.Write(Environment.NewLine) ' end of line
            sw.Flush() 'send the stream to file
        End If
 
 
 
        If OutputFileType = ".xml" Then
            xWriter.WriteStartElement("CUSTOMER")
 
            xWriter.WriteStartElement("ProjectID")
            xWriter.WriteString(Row.ProjectID.ToString)
            xWriter.WriteEndElement()
 
            xWriter.WriteStartElement("TransactionRefNum")
            xWriter.WriteString(Row.TransactionRefNum.ToString)
            xWriter.WriteEndElement()
 
            xWriter.WriteStartElement("CustomerNum")
            xWriter.WriteString(Row.CustomerNum.ToString)
            xWriter.WriteEndElement()
 
            xWriter.WriteStartElement("AccountNum")
            xWriter.WriteString(Row.AccountNum.ToString)
            xWriter.WriteEndElement()
 
             
 
        End If
 
 
 
       
       
    End Sub
 
    Public Overrides Sub PostExecute()
 
       
 
        If OutputFileType = ".csv" Then
            'Create the trailer
            sw.Write(Environment.NewLine) ' blank line
            sw.Write("RECORD_COUNT: " & Me.Variables.giSuccessCount.ToString) 'ReadWrite Varible
            sw.Write(Environment.NewLine)
            sw.Flush() 'send the stream to file
            'Close file
            sw.Close()
        End If
 
        If OutputFileType = ".xml" Then
            xWriter.WriteStartElement("RecordCount")
            xWriter.WriteString(Me.Variables.giSuccessCount.ToString)
            xWriter.WriteEndElement()
            xWriter.WriteEndElement()
 
            xWriter.WriteEndDocument()
            xWriter.Close()
        End If
 
    End Sub
 
 
End Class
 
 
 



 

View 6 Replies View Related

Jdbc Driver Creates New Thread For Each Statement With A Query Timeout Set

Jun 20, 2007

I am profiling a web application that is using the Microsoft JDBC driver, version 1.1 to connect to a sql server 2005 database. Each java.sql.Statement that is created, within the application, gets a query timeout value set on it ( statement.setQueryTimeout(...) ).

I have discovered that the JDBC driver creates a new thread to monitor each Statement and the query timeout value. When the application is under load these threads are getting created faster then they are being destroyed and I am concerned that this will cause a performance problem in production.

One option I have is to remove the query timeout value and the monitor threads will not be created, another is to change JDBC drivers.

I'm curious is there any way to control this behavior so that these threads are not created or are managed more efficiently. Is there a workaround that anyone is aware of? Is this considered a bug?

I have found a similar bug here for the 2000 driver:
http://support.microsoft.com/default.aspx/kb/894552

Cheers

View 5 Replies View Related

Opening Solution Creates Extraneous Xx.database Files In SSIS Project

Feb 9, 2007

I have a solution with a couple of ssis projects in it.  Everytime I open the solution, Visual Studio creates an extra .database file for the project's existing xxx.database file.  The solution is under VSS control and VS2005 checks out the project and shows the file as a newly added file.

What causes this and how can I prevent this from occurring?

The files contain this:

<Database xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dwd="http://schemas.microsoft.com/DataWarehouse/Designer/1.0" dwd:design-time-name="d3ce9653-3ac5-4ee5-85c3-7d60b2e5f109" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
  <ID>Publish</ID>
  <Name>Publish</Name>
  <CreatedTimestamp>0001-01-01T00:00:00Z</CreatedTimestamp>
  <LastSchemaUpdate>0001-01-01T00:00:00Z</LastSchemaUpdate>
  <LastProcessed>0001-01-01T00:00:00Z</LastProcessed>
  <State>Unprocessed</State>
  <LastUpdate>0001-01-01T00:00:00Z</LastUpdate>
  <DataSourceImpersonationInfo>
    <ImpersonationMode>Default</ImpersonationMode>
    <ImpersonationInfoSecurity>Unchanged</ImpersonationInfoSecurity>
  </DataSourceImpersonationInfo>
</Database>
 

There are 2 of us working on the solution and the other fellow does not see this behavior.

The files do not show up in the VS2005 solution explorer.  If they are user specific as I suspect (impersonation info?), then they should not be added to the .dtproj project file.

Thanks!

View 3 Replies View Related

SOAP Endpoint: When Using ROWSETS_ONLY Format - Warning In SQL Creates Corrupter Response

Apr 13, 2007

I have noticed that when I created SOAP endpoint and a webmethod uses ROWSETS_ONLY format €“ if a warning is raised in T-SQL implementing webmethod then response is being terminated.
Either nothing is returned, and calling application (build with VS 2005) gets error €œThe underlying connection was closed€?, or part of response is retuned but terminated in the middle, and calling application gets error €œThere is an error in XML document (1, 8001).€?
This can be caused by any warning, in my case it was €œ€¦NULL values eliminate by aggregate€¦€? warning. It will behave same way with errors.
Is there any way to make SQL Server send a proper response in case of warning? Should this be reported as bug to Microsoft?

View 4 Replies View Related

If I Had Any Hair Left I'd Pull It Out. How Do I Create A SSIS Package Which Creates A Table That Never Expires?

Mar 6, 2007

Hello everyone,

I'm not at all comfortable with SSIS so please forgive me if I overload you all with information here:

I need to create a data table using SSIS which does not delete the previous days data. So far all the data tables we use to write reports in Visual Studio are constructed in SSIS as follows.

1 - Excecute SQL Task - DELETE FROM STOCK
2 - Data Flow Task
3 - Data Reader Source - SELECT * FROM ODBCDATASOURCE
4 - OLE DB Destination (Creates table STOCK)

The data tables which are created this way are stored in a data warehouse and scheduled to refresh once a day, which means that any data from yesterday is lost when the updates run. So, I tried to create a table which never has its previous days' data deleted by using just the last three steps above - and it worked great in Visual Studio, no problem at all. However, when I added this SSIS Package to the Update Job in SQL Server Management Studio, the job totally rejected the packed with the message: "The command line parameters are invalid. The step failed".

I thought I could work around this problem by asking the job step to excecute a simple SQL query to insert the data from table1 into table2 (and would thus negate the need for a SSIS Packege at all), but it threw me a curve ball with some message about not being able to use proxy accounts to run T-SQL Scripts.

If anyone knows how to create a SSIS package in which the data never expires please could you impart some wisdom my way. I only need to do this once for a specific report.

Please, when answering, bear in mind that I'm a simple fellow with little understanding of the inner workings of SQL Server and its various components, so please use short sentences and simple words.

Thanks in advance,

Chris

View 25 Replies View Related

Database Automatically Creates Xxx_Temp Table While Modifying / Updating Table Structure .

Dec 16, 2007

Hello friends,

I am new to the SQL Server 2005 development.

From last 1 week or so, i have been facing very strange problem with my sql server 2005s database
which is configured and set on the hosting web server. Right now for managing my sql server 2005 database,
i am using an web based Control Panel developed by my hosting company.

Problem i am facing is that, whenever i try to modify (i.e. add new columns) tables in the database,
it gives me error saying that,

"There is already an object named 'PK_xxx_Temp' in the database. Could not create constraint. See previous errors.
Source: .Net SqlClient Data Provider".

where xxx is the table name.

I have done quite a bit research on the problem and have also searched on the net for solution but still
the problem persist.

Thanks in advance. Any help will be appreciated.

View 5 Replies View Related







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