I am new to this list server and have a dumb question. Does anybody know of any software that will document table/attributes very similiar to sp_help?? Basically, what I am looking for is some fancy documentor for tables very much like the one with access.
How can I create a Table whose one field will be 'tableid INT IDENTITY(1,1)' and other fields will be the fields from the table "ashu". can this be possible in SQL Server without explicitly writing the"ashu" table's fields name.
Is there any way to print a report with column name, datatype, size, etc in a report under SQL Server 6.5. I am looking for something like the Documenter which is available with Access 97. Karen Suenram
I'm so sure this is a clueless newbie question, I'm embarrassed to be asking it. The short version of my question is, "What's the best path to generating printed documentation of my SQL 2005 database?" The long version follows...
I've just completed the first draft of my new SQL database design (using Management Studio). We were previously storing our data in seven (yes, seven) separate Access databases, now I have everything set up quite nicely in one SQL db, all nice and relational and with proper field sizes and naming conventions, etc. It's all beautiful, but now I need to document it.
Why wasn't it documented first and then built? Let's just say I inherited this task in mid-stream with a looming deadline. Yes, I would have liked to follow a different workflow, but it is what it is and I am where I am.
So I can go through every table and type up everything in Word, but I'm hoping there's some feature in Management Studio that will give me a head start. I read the Help file under "documenting databases," and it says you can output the metadata as and XMLA script. Sadly, it doesn't actually tell you how to do this, which is rather unhelpful.
I'd like to end up with a document that list all my tables, with field definitions, indexes, keys, and triggers. Is there an easier way to get there than going table-to-table and typing it all out?
Is there a way to quickly document all tables and views a DTS package uses? Is there any system table/view which will hold this information?
For one of our projects we need to document these objects so that the client could remove unused objects from the db. There are 20 + DTS packages to go through.
I'm fairly new to a DBA role, I've been tasked with documenting all the SQL servers/databases. Is there anywhere on the Web where I could find a standard list of what needs to be documented. Any help/advice would be appreciated.
Hi All, I have a large number of SPs that I would like to be able to document and provide this documentation to prospective clients. That is, provide them enough information without giving them the source code for the procedures.
I have found that all the parameters are in the sys.parameters table.
But I was wondering. Are the fields that are sent back out of an SP captured and recorded somewhere in the SQL Server catalog?
Is there an easy way to find out what fields are coming out of an SP?
I would like to select transforms in a package and paste them as jpeg or similar into word or powerpoint in order to allow me to create a separate set of documentation.
However, whenever I copy some transformations and jump to word, the copy buffer is empty.
I am looking for an easy way to document the specifications of my tables, views, etc. In MS Access, one could use the "Documenter" utility to print out field names, data types, field sizes, and comments. Does SQL Server 2000 have a similar utility?
If not... 1. Why not? This would seem to be very useful. 2. What is the recommended way to document database specifications?
My ultimate goal is to develop an administration manual for our database.
Please note: I looked at the database designer diagram utility which is great for visually representing the relationships between tables. However, I am looking for a utility that will print out the field names, data types, field sizes and comments related to the fields.
I'm not sure how easy of a task this is, or how to go about it, so I thought I'd ask here. I am doing a major overhaul to my site and am re-programming the backend which involves re-formatting my tables, table names etc.
What I want to do is set up a new table in the format I want for the new site, but still be able to have the live data that is being submitted to the site now, be entered into the new table so that I don't have to shut down the site for days to transfer and reformat data. Example
CURRENT SITE
Table 1 Field1: Name Field2: Address
NEW SITE
Table 1 Field1: Name Field2: myAddress Field3: City
I want to be able to somehow map the two together so that when data is entered into the Name field on the current site, that same name is also inserted into the new site table as well. Mapping like this:
(current site)Name -> (new site)Name (current site)Address -> (new site)myAddress
The city field would be left unaffected as that data would only be entered once the new site is up and running.
I know I could do this from a stored procedure on the exiting site or by re-writting all of my SQL to insert into both tables, but right now all of the SQL is hardcoded into the pages and I have A LOT of pages. Is there a way to map the tables together from within SQL Server?
I need to get the names of tables and fields (or atleast the fields) from a database. Is there a query I can use that will return what all the db's tables and those tables fields are?
I have a database with approx 95 tables. I would like to get a printout of each table, the fields contained therein and the field type (i.e the information displayed when rightclicking a table in Enterprise Manager and selecting Properties).
I have tried to use the diagram function but due to the large number of tables the diagram is very complex and would have to be printed out on a huge sheet of paper to make it legible. I have also looked at the SP_HELP stored procedure but can't seem to get the syntax correct to display properties on all tables (info on one table is no problem).
I am working with the article that MAK wrote on SecurityLogs http://www.databasejournal.com/features/mssql/article.php/3515886
I have completed this, but I have made some changes to the database (for normalization to 3NF purposes). I now have problems with a query.
I am trying to "Insert a new record in a table if it does not already exist in the table". To try to clarify I perform the following query:
INSERT INTO Tmp_Event SELECT DISTINCT EventID, EventType, EventTypeName from Tmp
Which gives me the Tmp_Event table consisting of EventID's etc. (no duplicates). What I then want to do, is compare the 'Tmp_event' table and an already existing 'Event' table. These two tables are in fact identical. I would like to insert any records from 'Tmp_Event' into 'Event' if they do not already exist in 'Event'.
This query gives me all records that do not exist in 'Event'
SELECT EventID, EventType, EventTYpeName from Tmp_Event WHERE EventID NOT IN (SELECT EventID from Event)
How can I change this query into performing an INSERT INTO Event as well?
If possible, I would like to create a view using two different tables, but with the fields merged (ie. create one table from two tables). The table structures are pretty much the same. Can you do this from a singe SQL statement? Any ideas? My only alternative is creating a temp file that inserts records from both tables, but I want to avoid doing that.
There are more than hundred tables, so i wanna automate this. i am tryin to do this in a cursor: please guide!
declare @name VARCHAR (50) declare cur cursor fast_forward for select name from sysobjects where type='u' and status not like '-%' open cur WHILE (1=1) BEGIN FETCH NEXT FROM cur INTO @name IF @@fetch_status = 0 BEGIN ALTER TABLE @name ADD created_by [VARCHAR] (25) GO ALTER TABLE @name ADD created_by [VARCHAR] (25) GO ALTER TABLE @name ADD created_date [DATETIME] GO ALTER TABLE @name ADD modified_by [VARCHAR] (25) GO ALTER TABLE @name ADD modified_date [DATETIME] END ELSE BREAK END DEALLOCATE cur
I also want that if one column for a table exists; the other columns should be created rather than it quits.
For example, I have 2 tables that have very similar fields
Table 1 Table 2 ShipRpt ShipRpt invoice invoice total sold total sold
Is it possible to compare each of these fields and return any record that has non matching data? I would join the tables on the shipping report or invoice and only compare the total sold field. If the invoices match and the total sold is different in each table, can I just return the 1 record?
I am using a hosted MSSQL 2000 database that powers the backend of mywebsite. Website visitors interact with it via ASP pages I havedeveloped. I also have an internal FileMaker 7 database thatperiodically synchs with it via Filemaker's ODBC functionality.Several times now, I have come in one day to discover that my ASP pagesdon't work. When I look into it, one of my MSSQL tables will be missinga few fields. There is nothing in any of my code that sends an ALTERTABLE command or any other command that affects table structure. Thesedeletions of fields is totally random.The most recent example was with a table called FreeTeacherSubs. I justdiscovered today that three fields went missing:HowDidYouHearAboutYES TEXTFollowUpCallOrEmail TEXTHowMaterialsFit TEXTSuffice to say I am baffled! Has anyone ever experienced fieldsdisappearing from their tables?Kevin
What is the best way of documenting SSIS packages?I am not interested in purchasing any software, any general template that covers the key information of any SSIS package that should be defined and documented.
I feel sure that this is a very naive question, but it is freeky me out that I can solve it. With SQL server what is the easiest way to make a field other than the Primary key unique?Would appreciate help with this. ThanksPaul
Hi there, I have a fairly generic question regarding database design. I am working on my first database using SQL Express. I am testing the database by inserting records into the pre defined tables. Sometimes I forget to input text into a non null field. When this happens it displays an error and then skips a few rows which makes my row numbering messy. For example say I have Row 1, Row 2 Row 3 all nicely formatted but on Row 4 I make a mistake this row then disapears and their is gap between 3 and 5 where 4 was. Although I am just testing, I was wondering what happens in a real scenario if an inexperienced data input person makes a few mistakes it makes the database numbering systems look bad. In this case is it common to make most fields NULL to allow for admin errors??
Im writing a program in ASP language which it is using SQL Server for database.
I want to know how to create a link between fields of two tables. For example: I have a table named: Projects containing: p_name status date member1 member2
and another table named results containing: p_name s_status status1 status2
I want to create a link between field s_status of STATUS table and field status of table Projects
Users are sending data to table projects, when a user send some data to status of projects, I want this link to send data from status in project to s_status of results.
Question.I have a new table that I am adding to a script that I wrote. Thistable has 3 fields, the first 2 fields are used in the on statement asbeing = other fields in the script.The first field always has data in it, but the 2nd field is sometimesnull.So my problem is if both fields have data in them and they both matchto the data in the fields that I am linking them to, then it returnsthe 3rd field without a problem. However if the 2nd field is null thenit is returning a null for the 3rd field. I have checked and the fieldthat I am linking to is null also.So if I haveselect t1.field1, t1.field2, t2.field1, t2.field2, t2.field3from table1 t1join table2 t2on t1.field1=t2.field1 and t1.field2=t2.field2with 2 records in each tabletable1: record1: data, datarecord2: data, nulltable2: record1: data,data,datarecord2: data,null,datawhat I get from the script isrecord1: data, data,data,data,datarecord2: data,null,data,null,nullI would expectrecord2: data,null,data,null,dataI hope this makes sense, I didn't want to post the entire actual scriptas it is about 150 lines long.Thanks in advance.
Hello. I need some help constructing a query i need to run on my database. I need to add 2 fields to every table in my databse. However, some of the tables already have1 or both these fields so i need to somehow do a check if the dield already exists. If it does not create the fields. Im using a MS SQL express 2005 server. Could anyone help me construct this. Im pretty novice at SQL. Thanks.
I have the following cursor that I am comparing 2 tables, theproduction table and a copy of the production table, I want results ofall address's that are like the address1 field...the problem is...myresults are giving me every field and if there is more than one, it isputting it in a grid....I only want to see results if they are 1 for the same address fieldthis is what I have so far....declare @address1 char(61),@city char(61)declare address_cursor CURSOR FORSELECT address1,city FROM test.dbo.testaddOPEN address_cursorfetch next from address_cursor into @address1,@citywhile @@fetch_status = 0BEGINselect * from testadd where @address1 like '%' + address1 + '%' and@city = cityFetch next from address_cursor into @address1,@cityPrintENDCLOSE address_cursorDEallocate address_cursor