Changing Database Structures Through Code

Apr 28, 2006

I am having a hard time finding materials on this subject.  I am guessing I am using the wrong keywords to search.  Basically, I want to be able to modify database tables through a web form.  They can add columns and delete columns through the form.  I would just want to default the type of column and the length.  I am sure it has been done, I was just wondering if anyone had some resources they could throw my way.  I would appreciate it.  Thanks.

View 1 Replies


ADVERTISEMENT

How To Compare Database Structures?

Jul 20, 2005

Let us suppose that I have two similar databases and need to create ansql-script upgrating one database structure to another. For example, thesedatabases are from different versions of some software, first is from earlyversion, next is from current, and second one contains several new tables,sevelal new fields in old tables, several new or changed stored procedures,UDFs and so on.How to solve this problem using standard tools?

View 6 Replies View Related

Duplicate Table Structures To A New Database

Aug 7, 2007

Hi all expert,

Question as stated title above, how do I duplicate the table structure to another database whether it copies all columns, primary and foreign keys, default values, descriptions, constraints, indexes

Many thanks for the help.

regards,

View 8 Replies View Related

Exporting Table Structures To Another Database

Sep 26, 2006

We have databases with large numbers of tables. We have a separate database for each year. For various reasons, we need to export about 100 of the tables (Structure only, not their data) from last years database into this year's database. What is the best method for doing this? The import/export wizard creates the tables but does not bring in important things like keys.

Regards Shirley A

View 3 Replies View Related

Changing Code Pages

May 11, 2000

Hello,

Has anyone come up with an easy way to change the code page sort order in the master database. Unfortunately, I inherited two machines running different codes and neither one is ANSI standard. I would like to get them both back to ANSI. Each one contains approximately 15 custom databases.

Any suggestions except prayer would be much appreciated.

Thanks,

View 1 Replies View Related

Changing CssClass From Code Behind In Which Event?

Apr 11, 2008

 Hi, I have a formview with a label databound field in it. I want to change the labels CssClass property from code behind AFTER the record has been updated using a sqldatasource. In which event do I change the CssClass property? Or do I use Attribute.Add instead of setting the CssClass? Or is there some other property/method/way to accomplish this? Thanks, Z 

View 2 Replies View Related

Changing SSIS Production Code

Jan 14, 2008



I am curious to find out by other people on how they manage incremental code changes to SSIS packages. I am in a situation now where we deliver production SSIS packages to a client, where the client changes the connection details to the data sources and exectues the packages on a nightly basis.

We have had instances where clients are asking for enhancements and modifications to the SSIS package whereby we would develop it in our development environment then replace the existing copy in the clients production environment. There has been instances whereby the packages would work as desired on our end, but it requires further refinement on the clients side. As such, we have had instances where we had to "back-out" into the previous packages.

I am just trying to find out what methods or procedures other people are following to acknowledge situations like this or similar to this. Currently we are following an exhaustive method of having two copies of the code on the client side, the "live" code is never modified, just the secondary copy, then when all is good, we move this code into the "live" code. Does anyone have any means of performing incremental updates on SSIS packages easily?

View 8 Replies View Related

Changing Sort / Code Page When Upgrading

Jul 26, 2000

Any experience with upgrading from 6.5 to 7.0 and changing sort order / code page in the process? Does this cause problems or matter? We're trying to go with a standard and the servers I need to upgrade aren't at that code page standard.

Thanks..

View 2 Replies View Related

Changing Code Page Property Using Property Expression Doesn't Work

Jun 16, 2006

I am having problems exporting data into a flat file using specific code page. My application has a variable "User::CodePage" that stores code page value (936, 950, 1252, etc) based on the data source. This variable is assigned to the CodePage property of desitnation file connection using Property expression.

But, when I execute the package, the CodePage property of the Destination file connection defaults to the initial value that was set for "User:CodePage" variable in design mode. I checked the value within the variable during runtime and it changes correctly for each data source. But, the property of the destinatin file connection doesn't change and results in an error.

[Flat File Destination [473]] Error: Data conversion failed. The data conversion for column "Column01" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

[DTS.Pipeline] Error: The ProcessInput method on component "Flat File Destination" (473) failed with error code 0xC02020A0. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.

If I manually update the variable with correct code page and re-run the ETL, everything works fine. Just that it doesn't work during run-time mode.

Can someone please help me resolve this.

Thanks much.

View 5 Replies View Related

Changing Database Mail Host Database

Jan 26, 2007

Hi

I am trying to change the host database (MSDB) of Database Mail to some new database (say NewDB) and

unable to make DatabaseMail90.exe point to this new database (NewDB).

Is it possible to do this?

Thanks

Uddemarri

View 4 Replies View Related

FileGroup Structures

Apr 14, 1999

I have 2 test database identical in size and table structure, only one resides on filegroups and one resides on a single file.
From everything I have heard filegroups are suppose to improve performance. I stop and start the server before each test to clean out
cache. When I run the filegroup test initially the first run averages 20 seconds slower then the database sitting on the single file. However
on consective runs there is a significant improvement in performance with filegroups verses single files. I have
the indexes sitting on a separate filegroup and 2 additional filegroups to spread the tables across. Does any one know what would be causing
the performance to degrade on the initial run of the test. (The test by the way is a stored procedure that runs a select statement against each table).

Any Info Will help Thanks
Barb

View 3 Replies View Related

Tree Structures In SQL

Jun 11, 2006

Hi,

i'm writing a app in c# and have to store Trees in a Database.

I'm working with Datasets for the exchange between the DB and the App.

The trees have the same options like the windows folders. If u delete a node, all subnodes should be deleted too.

But something a Foreign Key from ParentID references (Id) with the delete-Rule on cascade seems not to be possible, because of multiple cascade Paths or cycles. Do i have to add some xtra constarins:

Not Possible:

create Table tree (
Id varchar Not null,
ParentId varchar Not null,
Constraint pk1 Primary Key (Id),
Constraint fk1 Foreign Key (ParentId) references tree(Id)
On Update Cascade
On delete CAscade
)


Do i have to write triggers, which delete The subnodes too and set the Update-/deleterulr on NO Action

Greetz

View 1 Replies View Related

Tree Structures...

Oct 24, 2006

Does anyone know any good links for SQL tree structures and example queries and stuff... I cant really find anything part from the standard example of emplyee, boss, salary which explains how to create the tree table...(dun dis bit) I did notice a book but I live in a little village so cant go get it till wekend?

I'm desperate, reli need to work out how too do this.....

View 14 Replies View Related

Data Structures

Nov 14, 2006

(Wow; surfing this site has really illuminated what a lowly hack-programmer I am to this field of SQL and relational processing :S )I am creating a temp table, doing an Bill of Material explosion for a single Order Line Item.(note: SQL Server 2000)I used blindman's "accumulator method (click here) (http://www.dbforums.com/showpost.php?p=6239109&postcount=6)" to generate the entire potential BOM tree.So; step 1 works wonderfully! :beer: Cheers blindman!Now; I want to remove unwanted nodes (and all their children) from the temp-table. I have a bunch of functions (0 to 1 for each node) that return a Yes or No. If "No", then flag-to-eliminate immediately that branch and don't revisit anything on it (and therein lies my problem). This will leave me with a temp table of only valid nodes.Since this is recursive, and since it will involve Dynamic SQL (the function name varies), all I can come up with is using a Cursor in a WHILE loop. Even at that; since a CURSOR is point-in-time (ie: values don't change once selected), I'll have to re-check the current temp table values (or create of 2nd temp table of only deleted nodes and repeat a SELECT with NOT EXISTS in it, hmmm).Since blindman's method generates a table ordered by level, the sequence of processing is pre-determined - unless I can re-order it into a more traditional hierarchy (1 entire branch at a time) and number the levels, in which case the cursor could just skip to the next branch of equal or higher level.Note: The thought does occur to me I could have an intermediary function (static name) that in turn does the Dynamic SQL. These functions contain the Business Logic that looks at a myriad of column values and relationships in the database and there's no one-size-fits-all decision tree so Dynamic SQL is necessary.The max cursor size will be maybe 300, and on average 100. Number of levels will normally be 3 or 4, but conceivably could be up to 10. Given the average 100 potential components/sub-assemblies, the final assembly will be about 30. As a periodic background process; it will do 3,000 Order Line Items a day, so I'm figuring 1 second response time per build is adequate (ie: the user's not waiting on it so it doesn't have to be blinding fast) - however why waste?Anyhow; I thought this might be a fun problem for some Data Structure genius who wants to give a lesson in Relational Programming.Thanks for looking.Here's what I have so far:CREATE PROCEDURE dbo.sp_ExplodeTest1 (@recID int = 1) AS/* tbTestH is a table containing an assembly hierarchy. Assemblies with no parent are Builds.Assemblies with no children are Components.It's columns: MyID int, ParentID int, (other descriptive columns)*/declare @t table (TempNodeID int identity(1,1),MyID int)-- Seed the tree with the Build's ID.insert into @t (MyID) values (@recID)/* This populates the temp table with the entire Assembly for the given build. It is Ordered By the level in the assembly. Number of assembly levels is infinite.For example: Level 1 = the Build. It comes firstLevel 2 = all parents are level 1. Is next (no particular seq)Level 3 = all parents are level 2. Is next (no particular seq)etc.*/while @@Rowcount > 0insert into @t (MyID)select tbTestH.MyID from tbTestHinner join @t rList on tbTestH.ParentID = rList.MyIDwhere not exists ( select *from @t CurrentList where CurrentList.MyID = tbTestH.MyID)-- now to display the results so far.select t.*, tbTestH.* from tbTestH inner join @t t on tbTestH.MyID = t.MyID order by t.TempNodeIDGO

View 8 Replies View Related

SQL Data Structures

Aug 9, 2007

What is included under SQL Data structures? Could anyone refer me to some good tutorials on that material?

View 2 Replies View Related

Mining Structures

Aug 23, 2006

I am using the wizard to create a new mining structure and getting the error at the time of selecting the datamining technique like either microsoft decision tree or microsoft timeseries etc.,

"Unable to retrieve a list of supported data mining algorithms. Make sure you are connected to the correct Analysis Services server instance and the Analysis Services server named localhost is running and configured properly. You can continue with a default list of data mining algorithms."

What is that means?

Thanks in advance,

View 3 Replies View Related

Printing Out Table Structures......

Nov 15, 2000

I have a SQL 7 database with about 30 tables in. For documentation purposes I need to print out the structures of each table. I have tried using the diagram tools but no joy.

I have access to Access, Crystal Reports, if these are any use?

Please help!!

Tony Kavanagh

View 3 Replies View Related

Tools For Db Structures Comparision

Jul 10, 2002

Hi,Does any of u folks used any tools for database structures comparision??

I have used DBDIFF(from DKGAS.com) ChangeManager from Embarcadaro and SQL COMPARE from Redgate.

I did have have some problem in each of these tools AND am looking for some good tools which are economical also.

Thx in advance
Ravi

View 2 Replies View Related

Complex Data Structures

Oct 5, 2001

A point for general discussion maybe.

I've just read Jeff's query regarding passing an array to a stored procedure, and it seems to be a question that hits the message board quite frequently. There often seems to be the case where you have some block of data in one location, and want to process it somewhere else, and there just isn't an easy way to do it (or is there?). Passing a cursor is possible, but getting data back out of a cursor is painful.

The ways I have used in the past are:

Using a cursor
Using a global temporary table
Using a "permanent" table, but declared with a unique name (using a timestamp) and passing the tablename as a parameter.

Has anybody any suggestions for a future SQL release which we could suggest to Microsoft?

Suggestions from myself:
-Having a single TSQL command to copy a cursor back into a table, to make cursor parameters less cumbersome
-Being able to pass a pointer to a temporary table as an SP parameter
-Allowing variables to be declared with more complex structures (such as arrays, or classes)

Regards,
ChrisH

View 1 Replies View Related

Table Structures Script

Dec 11, 2006

I will soon be writting a script which will search threw all tables in my database and try to find how they may be linked to one another, and also which tables are called by which stored procedures, any suggestions or tips would be great.

View 1 Replies View Related

Rendering Directory Structures

Oct 31, 2005

Hi, I have a table of folders that I would like to be able to displayin a depth first manner, similar to what you would see in WindowsExplorer. the table is defined similar toCREATE TABLE Folders (folderID int,parentFolderID int,name varchar(32)).... I've left some things out of the definition for the simplicity ofexample.My desire is to quickly generate a record set containing the all childfolders of a specific folder along with the how many levels deep eachfolder is, in a quick and memory efficient manner. I have done someresearch through this group and found a few examples similar to what Ihave hypothesized, however I was hoping for some feedback on what Ihave decided to use.Since this database table is already created and I cannot modify theexisting schema, it would not be very feasible to use a nested setsmodel (unfortunately -- or if anyone has a suggestion?).I plan on using a stored procedure that recusively calls itself.something similar to the following:/* This is assuming the table #TempFolderTable has* already been declared globally*/sp_FolderDisplayRecurive @folder int, @level int ASIF @@NESTLEVEL > 31 RETURN;DECLARE @childFolder INTDECLARE folders_cursor AS CURSOR LOCAL FORSELECT folderID FROM FoldersWHERE parentFolderID = @folderIDOPEN folders_cursorFETCH NEXT FROM folders_cursorINTO @childFolderwhile @@Fetch_status = 0BEGIN-- Insert current folder into-- folder table (under parent @folder)INSERT INTO #TempFolderTable(FolderID, DepthLevel, ParentFolderID) VALUES(@childFolder, @level, @folder)-- Iterate over all of its childrenEXEC sp_FolderDisplayRecursive@childFolder, @level + 1FETCH NEXT FROM folders_cursor INTO @childFolderEND...Will this incure a large overhead for a deep directory structure? Arethere any other problematic issues? Any suggestions and/or commentsare very welcome. Thanks!

View 3 Replies View Related

Comparing Table Structures.

Oct 18, 2006

Hi all,

Could anyone let me know if there are any Scripts available for comparing the schema differences between two SQL server databases?

Thanks

DBAnalyst



View 2 Replies View Related

Compare Tables Structures

Apr 1, 2008



Hi All,

I have 2 tables in different database. I need to compare the tables structure and insert the fields if not existing.

Ex:

I have 3 fields in table1.(database name Pubs)

Table1
F1
F2

F3

I have 2 fields in table2.(database name northwind)

Table2
F1
F2


I need to insert the table1.F3 into Table2. Basically i need to compare all the fields with table1, if not exist in table1 i need to insert that field into table2. I am using SQL Server 2000. Please send me the code.

Thanks,
Mears

View 7 Replies View Related

Open Source DB Structures

Oct 27, 2006

I'm wondering if anyone knows of a good site to find open source database structures (such as ERD's, scripts, or something of that nature)?

I think I have a pretty good handle on database design, but it would be nice to have a resource like that so that I can compare the design of my DB to DB's that people (smarter and more experienced than me) have created for similar purposes.

What I'm thinking of is a site like Open Source Web Design (www.oswd.org) for Databases. Anyone know of anything?

View 1 Replies View Related

Right Code Statements Of SqlConnection && ConnectionString For Connecting A Database In Database Explorer Of VB 2005 Express?

Feb 14, 2008

Hi all,

In the VB 2005 Express, I can get the SqlConnection and ConnectionString of a Database "shcDB" in the Object Explorer of SQL Server Management Studio Express (SSMSE) by the following set of code:
///--CallshcSpAdoNetVB2005.vb--////

Imports System.Data

Imports System.Data.SqlClient

Imports System.Data.SqlTypes

Public Class Form1

Public Sub InsertNewFriend()

Dim connectionString As String = "Data Source=.SQLEXPRESS;Initial Catalog=shcDB;Integrated Security=SSPI;"

Dim connection As SqlConnection = New SqlConnection(connectionString)

Try

connection.Open()

Dim command As SqlCommand = New SqlCommand("sp_insertNewRecord", connection)

command.CommandType = CommandType.StoredProcedure
.......................................
etc.
///////////////////////////////////////////////////////
If the Database "shcDB" and the Stored Procedure "sp_inertNewRecord" are in the Database Explorer of VB 2005 Express, I plan to use "Data Source=local" in the following code statements to get the SqlConnection and ConnectionString:
.........................
........................

Dim connectionString As String = "Data Source=local;Initial Catalog=shcDB;Integrated Security=SSPI;"

Dim connection As SqlConnection = New SqlConnection(connectionString)

Try

connection.Open()

Dim command As SqlCommand = New SqlCommand("sp_insertNewRecord", connection)

command.CommandType = CommandType.StoredProcedure
........................
etc.

Is the "Data Source=local" statement right for this case? If not, what is the right code statement for my case?

Please help and advise.

Thanks,
Scott Chang

View 6 Replies View Related

Changing Database Name

Nov 19, 2002

hi, I have created a database in sql server 2000. I need to duplicate the database under different name, how can I do that?
Also, can I rename a database name?
thanks
Ali

View 3 Replies View Related

Merging Two Databases With The Same Table Structures

Oct 20, 2000

Hi
I have a problem out here. I have two databases with the same table structure
and I want to merge data from both the tables . Please can anyone let me know.
Iam using Sql Server 7.0.

Thanks
Bye

View 1 Replies View Related

Printing Out Table Structures, Rows

Dec 5, 2000

Hello !! :O)

I have a SQL 7 database with some tables in. For documentation purposes I need to print out the structures of each table and all the rows in every table.

Please help!!

Thanks

View 2 Replies View Related

Copy The Table Structures Of All The Tables

Nov 16, 2006

CREATE TABLE table_name AS SELECT STATEMENT WHERE rownum = 0; this query will copy the table structure of one table without copying the data. I need to copy the table structures of all the tables in a particular database without copying the data.suggest me on this.

View 6 Replies View Related

Sql Server 2005 And Tree Structures

Mar 9, 2007

I am trying to traverse a tree structure like below,

1 Pets
--1.1 Cat
----1.1.1 Persian
----1.1.2 Bengal
--1.2 Dog
----1.2.1 Poodle
2 etc

I would like to be able to search by a keyword, i.e. Poodle, or the reference number, i.e. 1.2.1. I would prefer to do this all through a stored procedure if possible, it seems recursion is the way to go as the number of levels may increase in the future but i'm completely new to this. From what i've seen so far I would need a table structure with a parentID,NodeID,Name field and Primary key.

i.e,

ID...Name......Parent.....NodeID
1....Pets.........0............1
2....Cat..........1............1
3....Dog..........1............1
4....Persian.....2............1
5....Bengal......2............2
6....Poodle......3............1
etc

i've heard that SQL SERVER 2005 provides recursion through CTE, is this the recommended way/only way to achieve this?

Any tips on where to start would be really appreciated.

View 3 Replies View Related

Concurrency Issues With Tree Structures.

Jul 23, 2005

Hi,I'm currently implementing a database with a tree structure in a table. Thenodes in the tree are stored as records with a column called "Parent". Theroot of the tree has a "NULL" parent. The path to each node is stored inthe column "Path" and is of the form "000010000200003" etc. Thelatter enabling me to fetch subtrees using the "LIKE" predicate. I alsohave created the relation "ID" <-> "ID_Parent, effectively the table isrelated to itself. I did this so that an attempt to remove a parent whenthat parent still has children will fail due to referential integrity.Unfortunately, in order to delete subtrees, I have to first set all of thenodes in the subtree to point to the "NULL" parent so that I don't getcaught with integrity errors during deletes.Unlike a typical linear system, any given node record is related to morethan one of the other records. What I mean is it is possible to follow achain from any given node back to the root (ancestors) or collect a seriesof branches and leaves (descendants) and so it is not reasonable to considerany given node in isolation. Changes to any given descendant can triggerchanges which are propagated to it's ancestors. I am not using recursion todo this, rather, I am using an iterative approach to select and update theparent, then the parents parent, etc. according to it's new state (given bythe state of it's immediate descendants), right back up to the root.Now, the problem comes when I consider concurrency with respect to thisscheme. It seems to me, that locking the record I am updating is notsufficient to ensure clients are kept synchronised or the integrity of thetree structure is correct. I think I need to lock all ancestors of the tree(HOLDLOCK) before performing any operation on a given node. Is thisreasonable? Also, consider the "delete" problem given above. I reallyshould HOLDLOCK on the entire subtree of any node I wish to delete as I amgoing to set the entire subtrees parent values to NULL. I don't wantanother client to perform a read on part of the subtree while the nodes are"parentless" pending deletion.Secondly, I am not sure how to handle synchronization of the tree for eachclient. How does each client know when a change has been made to the tree?Consider a client holding a copy of the tree in memory. Another clientdeletes a subtree. The first client attempts to update one of the deletedsubtree nodes and fails because the node no longer exists. At this point,in the eyes of the first client, all of the ancestors and all of thedescendants of the node in question must become suspect. Should thesoftware now attempt to re-build this part of the tree? It seems that anyoperation on any of the nodes in the tree will potentially make a lot ofother nodes suspect and so my application will be doing a lot of updating.I would be interested to hear any insights people have on these issues,particularly those implementing a "file system" structure in their databaseor similar. How do you deal with these concurrency issues when manipulatingtrees?ThanksRobin

View 4 Replies View Related

'Diff' For Tables *structures* Rather Than Data

Jul 20, 2005

If I have two sql server databases that started out with identicaltable/key/index structures, but were not properly kept in sync, isthere any way I can generate a table change script to essentially'diff' the two databases and come up with table change scripts tobring one in line with the other?An answer to this age-old question of mine would make me veryhappy...!Brian

View 2 Replies View Related

How Can I Print Table Structures In SQLExpress

Oct 20, 2006

I need to get a print out of column names, types, and properties for each of the tables. We just started using SQL Express from Access. I cannot find any reference to printing the structures in Microsoft SQL Server Management Studio Express.

Thanks

View 6 Replies View Related







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