Xml File And Automatically Parse NODE Names Into A Memory Variable Table

Sep 13, 2014

Ok I am faced with working with XML on a regular basis, which is fine.

DECLARE @ViewSN INT
IF NOT EXISTS (select null from tblviews where viewcode = 'loadAtTerm') --<workflowEventType>loadAtTerminal</workflowEventType>
insert into tblviews (ViewName,Description,OutBoundForm,StoredProcSN,TriggersReply,ViewCode,DispXactLayer,DispXactViewType,DispXfcTag,Comments)
select 'QC:WF-LoadAtTerminal','This View Corresponds to the XML for loadAtTerminal in Omnitracs Workflow','0',NULL,'0', 'loadAtTerm','MCOM','MCOM',NULL,NULL

[code]...

What would be really useful is to be able to present any xml file and automatically parse the NODE names into a memory variable table and then the fields of each node in another.

View 7 Replies


ADVERTISEMENT

How To: Variable File Names When Exporting A Report To A File Share

Jan 19, 2007

I'm exporting reports daily to a file share and I need to rename the reports with a pseudo time stamp.

Example: I have a report named "Disk Usage" and when I export (using a data-driven subscription) I want to rename it "Disk Usage - (Jan07)" - or something to that effect.

Can anybody tell me how to accomplish this.

View 1 Replies View Related

Dynamically Pass Table Names And File Names To IS Package

Mar 1, 2015

I am designing a package to export staging tables into a flat file.The names of the tables will be: TableAStaging_YYYYMM and TableBStaging_YYYYMM. As you can see the names of the tables will be changing each month.

The flat files will have similar naming: C:MyPathFlatFileTableAStaging__YYYYMM and C:MyPathFlatFileTableAStaging__YYYYMM.I want to run the package as an sql job in two steps, one for each table.I need to dynamically pass the table names and file names (together with the path) to the IS package.

View 1 Replies View Related

Variable Table Names

Jan 29, 2001

Can I do something like the following with SQL Server?

DECLARE @Table_Name varchar(100)

SET @Table_Name = 'Accounts'

SELECT * FROM @Table_Name

View 2 Replies View Related

Variable Table Names In DTS Package

Jul 20, 2005

I am attempting to export data on a daily basis via DTS to an XLspreadsheet. I would either like to: a) have a separate worksheet inthe spreadsheet for each export or b) a completely differentspreadsheet for each export. Whenever I attempt to use a variable asthe name of my table in the DTS package, it will not let me.Constructing a string and attempting to execute it also fails,although both of these work in query analyzer. Any advice?Peter

View 1 Replies View Related

Node Automatically Fails Over Nightly (Urgent Help)

Aug 23, 2002

I need some help. I'm running Win2000 w/SQL 2000 Active/Active cluster. I've started having problems where one node will fail over automatically every night. The times are different each night and the only thing that shows up in the log file is the SQL Server terminated due to stop request from the service control manager. I can't find any error to point me in any direction. Does anyone have any idea what could be causing this?

Thanks,

Jeff

View 1 Replies View Related

Automatically Expand Identity Specification Node?

Mar 1, 2006

subject says it all -- is it possible to automatically expand the identity specification node in table properties for the Management Studio or VS2005 diagram mode? when creating a DB, it seems ridiculous that for EVERY table I have to add an extra click to get to just one more clickable item that ought to be exposed by default.

View 7 Replies View Related

How To Create Table Names By Using Macro Variable? Thanks!

Oct 21, 2005

Greetings!I am now doing one type of analysis every month, and wanted to creattable names in a more efficient way.Here is what happens now, everytime I do the analysis, I will create atable called something like customer_20050930, and then update thetable by using several update steps. Then next month I will create atable called customer_20051031. Does anyone know if there is a betterway to do it? like using a macro variable for the month-end date? Noweverytime I have to change the table name in every single update step,which would cause errors if I forget to change one of them. By using amacro, I would only need to change it once.Thanks!

View 8 Replies View Related

Passing Variable Table Names To Stored Procedure

May 5, 2000

I need to execute a stored procedure which selects all columns from the passed table. The table used is a variable.

Select * from @Passedtablename. This won't work. Any insights.

View 1 Replies View Related

SQL Tools :: Can Make SSMS Parse Command Resolve Object Names?

Jul 29, 2010

When I run the parse command in SSMS, it merely does a syntax check.  When I run through the export data wizard by right clicking on a table, it allows a query as the data source.  When I click on the parse button in the window that accepts that query, it resolves object names and notifies me of invalid ones.  I'd really like the same thing to happen when I parse in SSMS...

View 5 Replies View Related

Recovery :: OS Memory Reservation For Two Node Cluster Having Three Instances

Nov 9, 2015

We are running with a 2 node windows cluster having three SQL instances on it. 

OS: Windows server 2008R2 SP1
SQL : SQL server 2008R2 (10.50.6529)

Currently both nodes have 256 GB or memory and we are having multiple auto failover for resources. What will be the best practice for OS memory reservation (OS+tools) so that we can set SQL max memory settings accordingly?

View 5 Replies View Related

DB Engine :: Defining MAX And MIN Server Memory Settings On 2 Node Cluster

Sep 29, 2015

On first Node A: The server has 16 GB of physical RAM. 
On second Node B: The server has 10 GB of physical RAM.

Now, this being Active Active, Node A can be clustered on failure onto Node B..Now reporting server is configured under these two nodes, with defined MAX and MIN server memory of 12 as MAX and 0 is min IN GB.Now with this setting on SQL whenever the cluster moves, such config make OS goes low on node for 10 GB.I am only left with option of switching this MAX and MIN to a default setting or is there any other alternative such as script which can change this setting accordingly when cluster moves to respective server.

View 7 Replies View Related

Upgrading Memory In A SQL 2005 2 Node Active/passive Cluster

Sep 14, 2007

Could someone give me an ideal of what it takes to upgrade the memory in my cluster. Is it as easy has upgrading the passive node, switching the nodes, then upgrading the other server. And do I need to re-configure the windows cluster. And will both server need to be down at the same time at any point.

Or is their more to the process? Thanks for any assistance.

btw, I currently have 16mb of RAM in each node.

View 3 Replies View Related

SQL Server Memory Not Cleared Automatically

Mar 3, 2008



I have installed sql server 2005 in cluster. after all the process is finished the memory usage is showing 2 gb where as in the activity monitor there is no process running. what should i do to clear the memory automatically.

If i stop and start the serverice it is cleared, nor do i want to run any command to clear the memory.

View 1 Replies View Related

Exporting A Table With Changing Column Names To An Excel File

Oct 25, 2006

I'm trying to write an SSIS package that exports a table that has changing column names to an excel file. The column names change due to the fact that the table is created by a pivot daily. the only thing I'm missing is the ability to dynamically map the tables' columns to the excel destination. Is this possible?

I read in another thread that
"It is not possible to create packages or new objects within packages using SSIS."
I also read in the books online that "The input and the input columns of the Excel destination have no custom
properties." To me this means that I cannot programmatically create or remove columns in the excel destination. Please tell me I'm wrong.
So, to summarize my research so far. In writing an SSIS package, I cannot programmatically create a new excel destination object and I can't manipulate an existing one. I hope I'm wrong. Can anyone help me? (and please correct any wrong assumptions I may have stated)

View 2 Replies View Related

Parse Flat File

Mar 31, 2008

This package will do very simple thing. It will parse the file and load it into table.

The format the file will be with fixed position:

From position 1 to 18, I need trim all the ending space and map it to a field of base table.

1. This is what I have done in the sql 2000 DTS package. How do I do the twist of data mapping on the SSIS?

I was using Active-x script in the 2000 DTS package.

EmployeeNumber = Trim(DTSSource(1))
EmployeeNumber = Left(EmployeeNumber, Len(EmployeeNumber) - 1)


2. At the Contrl Flow tab, I only have "Data Flow Task". I don't see the place I can do expression.

Thanks.

View 1 Replies View Related

Parse Flat File

Mar 31, 2008

This package will do very simple thing. It will parse the file and load it into table.

The format the file will be with fixed position:

From position 1 to 18, I need trim all the ending space and map it to a field of base table.

1. This is what I have done in the sql 2000 DTS package. I was using Active-x script. How do I do parsing when I map the field to the table?

EmployeeNumber = Trim(DTSSource(1))
EmployeeNumber = Left(EmployeeNumber, Len(EmployeeNumber) - 1)

2. At the Contrl Flow tab, I only have "Data Flow Task". I don't see the place I can do expression.


Thanks.

View 1 Replies View Related

Parse A Flat File

Mar 31, 2008



This package will do very simple thing. It will parse the file and load it into table.

The format the file will be with fixed position:

From position 1 to 18, I need trim all the ending space and map it to a field of base table.

1. This is what I have done in the sql 2000 DTS package. I was using Active-x script:

EmployeeNumber = Trim(DTSSource(1))
EmployeeNumber = Left(EmployeeNumber, Len(EmployeeNumber) - 1)

2. At the Contrl Flow tab, I only have "Data Flow Task". I don't see the place I can do expression.

Thanks.

View 3 Replies View Related

Determine Table Names And Column Names At Runtime?

Jan 22, 2004

Hi

I was wondering if anyone has an idea of how we could find the table names and column names of the tables in our Sql server database at runtime/dynamically given our connection string? Please let me know.

Thanks.

View 5 Replies View Related

Parse Text File (csv, Fix Width), Perl Or Something Newer?

May 26, 2007

I need to parse some text files and load them to database - these files are mostly CSV files or fix width columns format and the column names (first line) may vary in text (e.g. different abbreviation), order and extra columns, etc.

Is it a good idea have this done using script task of SSIS? How it compare to Perl on performance? Or any other tools good for this?

View 7 Replies View Related

SQL In-Memory :: Table Memory Optimization Advisor Validation Passed But Cannot Migrate

Jul 13, 2015

I am looking to test this feature - and the "Transaction Performance Collector" has recommended me a table to port to In-Memory OLTP. 

I have now tried the "Table Memory Optimization Advisor" tool.

After a couple of tweaks to the table design - the tool is now passing validation but the tool is not allowing to progress to the next step:

Could it be down to not having enough memory? But would this not show in the advisor?

View 4 Replies View Related

Variable Column Names

Mar 15, 2004

I am writing a stored procedure in which I have a query that selects the Headings of Columns from another table...
I want to then create a loop that will contain a variable with the value of the column heading and then set the column to a value of NULL...

Is there any way to accomplish this???

I thought about placing these values into a temp table...

This is what I have so far...

Declare @QueryX nvarchar(500)
Declare @FieldName varchar(20)

Create Table #UpdateRejDoc
(
Abbreviation varchar(20)
)
Insert into #UpdateRejDoc
Select Abbreviation
From tbl_Titles
left JOIN tbl_TitleRouting on tbl_Titles.Title_ID = tbl_TitleRouting.Title_ID
Where tbl_TitleRouting.Application_ID = @Application_ID
While Exists (Select Abbreviation from #UpdateRejDoc)
Begin

Set @QueryX = 'Update DBLandfillUser.tbl_ObjectApprovals' +
'@AppName + Set @FieldName = null Where object_id =' + Cast(@object_id as VarChar(20))
End

View 1 Replies View Related

SQL Doesn't Like Variable Names In Commands?

Jan 29, 2007

Hello,
Why would this issue syntax errors? How can it be made to work?

DECLARE @TKey as BigInt
DECLARE @TName as VARCHAR(32)
DECLARE @Tid AS VARCHAR(32)

SET @TKey=99
SET @TName='TestTABLE'
SET @Tid='TestTABLEID'

SET IDENTITY_INSERT @TName ON

INSERT INTO @TName (@Tid) VALUES (@TKey)

SET IDENTITY_INSERT @TName OFF

--PhB

View 9 Replies View Related

Table Names And Field Names

Jan 21, 2004

I'm trying to do an update query that looks like this:

UPDATE

PAEMPLOYEE

SET PAEMPLOYEE.LOCAT_CODE = EMPLOYEE.PROCESS_LEVEL


FROM

PAEMPLOYEE A

JOIN EMPLOYEE B ON A.EMPLOYEE = B.EMPLOYEE

It's erroring out on the Employee prefix B.EMPLOYEE saying:

..."does not match with a table name or alias name used in the query"


Is it wrong or will it cause problems to have a field name the same as the table name?

View 5 Replies View Related

Column Names From A Variable Without Execute Statement

Oct 11, 2002

Is there anyway anyone knows of that i can select columns using variable names without building an execute statement??

ie.

DECLARE @col varchar(10)

SELECT @col = "AuditID"

SELECT @Col FROM tblAudit

??

Anyhelp a bonus

Thanks

Daniel/

View 8 Replies View Related

Moving From One Table To Other Table Automatically For Every 3 Months By Checking The Paticular Value Of The Table Field

Mar 29, 2007

Hi
 
I am having a table called as status ,in that table one field is there i.e. currentstatus.
the rows which are having currentstatus as "ticket closed",i want to move those rows into  other table called repository which is having same table structure as status table.
I can do programatically.
but is there any way for every 3 months system has to check and do this action means moving to repository table automatically?
 
Please help me.
 
Thanks.

View 1 Replies View Related

SQL 2012 :: Log Shipping - Reboot Secondary Node And Then Primary Node

Apr 20, 2015

I have not used log shipping before and find myself in a position where I need to reboot the secondary node and then the primary node and I don't actually need to failover.

Is there anything I need to be aware of. When rebooting the secondary node I assume the transactions will be held in the primary nodes log till the secondary comes back and just carry on once back up?

When rebooting the primary node nothing needs to be done and the log shipping will just start again once it has come back?

View 3 Replies View Related

Do I Need To Install SQL Server To Second Node In Cluster Prior To Adding The Node?

Jun 12, 2007

I read these instructions:

http://msdn2.microsoft.com/en-us/library/ms191545(SQL.90).aspx



But I'm not sure if I have to install SQL Server first on node 2, then add it to the cluster. Or does adding it to the cluster also install the software?



Thanks

View 1 Replies View Related

SQL 2012 :: Parse XML Data To Table Format

May 5, 2014

declare @xml table (xmldata xml)
insert @xml select
N'<parseObject name="Motel">
<fields>
<field name="vehicleno" fieldType="int" fieldSize="">

[Code] ....

I want to extract data in in table format

ParseObjectName FieldType FieldSizeGrammar
Motel VehicleNo Int NULL div.biz-page-subheader li > span.i-phone-biz_details-wrap
mapbox-icon span.biz-partno[/size]

View 2 Replies View Related

SQL 2012 :: Parse XML Files Into Relational Table

Sep 24, 2014

We have a project to parse out an xml file into relational sql table. The xml file is complex type with multiple nesting. We are trying to resort to use XQuery to parse it out to SQL tables-because of one thing or the other - other options on the table were not viable. I know that we can use C# to do the same thing but we are sticking to TSQL with Xquery. Has anybody used the same route for processing large complex xml files?

View 1 Replies View Related

T-SQL (SS2K8) :: Function To Parse Each Command In The Table

Nov 19, 2014

I am debugging a DB maintance script which creates a table of index maintainance commands which are created separately for each index according to the level of fragmentation and other factors.

For the debugging process, I'm looking for a way to parse each command in the table without actually running them to locate any syntax errors. In other words, as if you clicked the blue check on each one.

Does such a function exist in SQL 2008 (the version I'm doing this on) or other versions?

View 3 Replies View Related

Integration Services :: Move Multiple Files Based On File Names Listed In A Spreadsheet / File?

May 27, 2015

I need to move specific files from a server to another server on a monthly basis.  There are hundreds of files that are in the source directory and I need to move approximately 40 of those to the destination server.  I would like to easily add or delete the file list as needed.  I have seen where several variables were created for for each file name (and one for the path) and the ForEach Loop would go through them.  With 40 or more I was thinking that I could make a connection to an Excel spreadsheet or text file with a record for each file name and read in and and move to the next record and make that value become the content of a "FileName" variable.  Then if I wanted to add another file name I could just add another record to spreadsheet/text file or remove and the package would handle automatically....

View 10 Replies View Related

Is It Possible To Use Twice Declared. Variable Names- KILL And After Declared. Variable

May 1, 2008

is it possible to use twice declared. Variable names-
declared. Variable and after KILL
and use the same declared. Variable
like

DECLARE

@StartDate datetime

KILL @StartDate datetime (remove from memory)
use after with the same name

i have 2 big stored PROCEDURE
i need to put one after one
and psss only 1 Variable name to the second stored PROCEDURE
like this i don't get this error


The variable name '@Start_Date' has already been declared. Variable names must be unique within a query batch or stored procedure.

Msg 134, Level 15, State 1, Line 146

The variable name '@End_Date' has already been declared. Variable names must be unique within a query batch or stored procedure.
i use like
KILL @endDate ??
KILL @StartDate ??


TNX

View 12 Replies View Related







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