Adding Comments To Metadata

Mar 15, 2008

Did some searching and didn't seem to find what I'm looking for. I'm pretty new to SQL Server (most of my experience is on DB2 for z/OS).

I'm building some new tables, and want to find a way to add comments to the metadata for the column. In DB2 the syntax is:

COMMENT ON COLUMN TB_CREATOR.TB_NAME.COLUMN_NAME IS 'comments here';

OR

COMMENT ON TB_CREATOR.TB_NAME (
COLUMN1 IS ' comment here',
COLUMN2 IS ' comment here',
);

Is there anything like this in SQL Server?

Thanks!

View 9 Replies


ADVERTISEMENT

Adding Comments To A Report

Jan 7, 2007

I would like to allow users to add a comment to a report. What is the best way to do this? When the report is run I would like users to be able to see all comments and which user reported them and the date and time the comment was entered

View 1 Replies View Related

ADDING COMMENTS IN A SINGLE STRING

Apr 23, 2007

Hello,
I would like to know if it is possible to add comments from different columns from table in sql into a single column. Please, see the attached table. I want all comments to be in one column. The outcome should be:
CONFIRMED NEED TO CONFIRM SIGNER AT <CR><LF> received e-mail:<CR><LF> Called Imran again today to see if .



Ideally, I would like to receive all comments in a single string of characters, perhaps separating the comments by <CR><LF>

Here is the table. Sorry my table doesnt look good, but it has the following fields: DATE, LEXNEX_DECISION, COMMENT

DATE LEXNEX_DECISIONCOMMENT
4/3/2007COMPLETECONFIRMED NEED TO CONFIRM SIGNER AT 4/3/2007COMPLETEreceived e-mail:
4/3/2007COMPLETECalled Imran again today to see if .

Help!

View 1 Replies View Related

Adding Comments To TEXT Field...

Jul 20, 2005

Newbie question:Aside from the single quote (i.e. chr(39)) what other characters can causeMS-SQLserver to cough-up the insertion / update back in your face?TIA

View 1 Replies View Related

How Can I Display No Comments If There Is Not Any Comments ??

Oct 1, 2007



Hi all,

I have state, day_date, error, and text column. If there is data then it is showing all the columns. But if there is no comments I would like to show no comments in the text field. Currently I have this store procedure.




CREATE PROCEDURE dbo.up_daily_quad_text

@DAY_DATE datetime



AS

BEGIN

SELECT

dbo.adins_database.ZONE_NAME + ', ' + dbo.adins_database.ZONE_STATE AS [STATE AND LOCATION],

dbo.COMMENT_CATEGORY.NAME,

dbo.COMMENT.TEXT

FROM

dbo.adins_database,

dbo.COMMENT_CATEGORY,

dbo.COMMENT,

dbo.DIM_DATE

WHERE

( dbo.adins_database.adins_id=dbo.COMMENT.adinsdb_id OR (dbo.COMMENT.adinsdb_id is Null) )

AND ( dbo.COMMENT.comment_dt=dbo.DIM_DATE.DAY_DATE )

AND ( dbo.COMMENT_CATEGORY.category_id=dbo.COMMENT.category_id )

AND

dbo.DIM_DATE.DAY_DATE = @DAY_DATE

END

GO

GRANT EXECUTE ON dbo.up_daily_quad_text TO AdIns_SSRS

GO




How can I modify do that.

Thanks

Rozar2007

View 7 Replies View Related

SQL 7.0 SP1 Is Out. Comments?

Jun 7, 1999

Well, the time is here, SQL 7.0 Service Pack 1 is out.

I'm sure the bravest of us have already fetched and installed it. (I'm currently downloading it myself)

Any problems so far everyone? I'd really like to hear from anyone running 7.0 SP1 on a big alpha system.

Anthony B. Kenitzki

View 1 Replies View Related

Comments In SQL

Nov 15, 2006

Hi,

I am new to MS SQL Server 2005. I used MySQL.

Now my doubt is how to put a comment in SQL statement, where i am using query editor in SQL Management Studio.

Rgds.,

Aazad

View 1 Replies View Related

Comments

Mar 1, 2007

hi

how can i put comments in rdl (XML)???

Thanks

View 1 Replies View Related

Comments Table Help

Jun 28, 2007

Hi everyone.  I've taken a while off of developing site in ASP.net but had a site that I wanted to upgrade a little, but needed a little help.What I have currently is a website of a person with videos and images of that person.  To view the videos, I have a "view_video.aspx?ID=" page that plays the video from YouTube by looking my database for the ID, YouTube URL, Name, and Description.  What I want to do is create a "comments" table for visitors to add comments for each video and then display all comments on the page.So far, my "comments" table looks like this. ID, otherID, name, email, comment, type, date.The ID is the id of the comment, otherID is the foreign key to the "videos" table, the name is the name of the person leaving the comment, e-mail is for the person, comment is the text, type is the type of video (tutorial, sampler, random video), and date is a timestamp for when users leave the comment.So hopefully I have a good start.  I don't have any code to show right at the moment for I am at work, but if anyone has any ideas or critiques so far, I'd love to hear them.  This is an interesting project for my friend and I'd love to implement this sometime.Thanks,TetrisSmalls 

View 1 Replies View Related

Getting Table Set Up For Comments

Mar 10, 2004

I am working on a project that lets visitors to my webpage post comments. I have there name, city, etc. stored into an sql database. This all works until I put text into the comments field of my form. I get this message when it is trying execute -- String or binary data would be truncated. I was wondering what data type to use, I have used char and varchar and neither one is working. Is there anything else I could try to fix this.

View 1 Replies View Related

SP3 Comments Needed

Sep 26, 2001

Anyone using SQL 7.0, SP3 on production ? Any comments
on the upgrade from SP2, any quirks, gotchas that you
experienced?

Any input appreciated!

thanks!
Bruce

View 1 Replies View Related

Can A Field Have Comments ?

Jan 20, 2000

We're migrating from Access to MS SQL server 7.0
Inside the edit of an Access tables; the Description column can also be used to place comments other then the description of the field,
ie. explanation of field's use
pay payrate per hour in USD
or allowed values
status O=open, C=closed
I can not find something similar inside SQL 7.0.
If this option is not available, what other alternatives are there ?

Patrick

PS. what is the CTEXT field inside the SYSCOMMENTS table ?

View 1 Replies View Related

Table Comments

Jun 4, 2002

Has anyone discovered how to store table and column comments inside SQL Server 2000? It was supposed to be an added feature with 2000.

thanks!

View 1 Replies View Related

How Do I Set Up User Comments

Sep 16, 2007

I am trying to plan out a database that will have users and comments on those users. How should I structure this? Should each comment be attached to the user it describes or should each user have a list of the comments that describe it?

View 5 Replies View Related

Some Comments On DTS Package

Jul 23, 2005

On quick observation, it seems to me DTS has a strange way tointerprete File System. ENV: NT OS, SQL Server 2000.When a data import package (source point to c:XYZdir) is executed atEM level, sql server seems to think the "c:XYZdir" is the currentuser's "c:XYZdir", however, if the same package is scheduled as a joband executed as a job, then, sql server seems to think the "c:XYZdir"is THE SQL SERVER INSTALLTION MACHINE's C:XYZdir. It's quiteinconsistent. Please let me know your finding about this.Also, I use ActiveX scripts to perform exception handing (errorchecking) for certain transaction. For instance before a packageimports a file an ActiveX script checks source file's existence andformat, if not as expected halt here (not to execute the package).Now, the two cases of (a) file not exist; and (b) incorrect file formatcan't be determined by not running the package. Probably, the ActiveXscript should capture each case by creating a record/row during thefile checking. What's your thought?TIA.

View 4 Replies View Related

SSIS Comments

Jul 20, 2007

Hi all,

i am not sure is it have the way to comments some process on the package.



Thanks,

View 4 Replies View Related

Read Before Committed, Comments?

Mar 10, 2000

Consider this example please.
BEGIN TRAN
insert into OrderDetail (fields) VALUES (values)
insert into Orders (fields) VALUES (values)
COMMIT TRAN

If there is a trigger on Orders that takes some fields from OrderDetail and puts them into some other table.

When the trigger fires, can it find the details if the COMMIT has not occurred yet.

I'm wondering If I should use isolation level READ UNCOMMITTED.
After all, If the whole transaction rolls back, my trigger activity will be rolled back as well. Comments?

View 1 Replies View Related

Table Level Comments

Jul 13, 2004

Is there a way to add comments on a table in sql server?

View 14 Replies View Related

Generating Document From Comments In Sql

Sep 4, 2005

hai everyone
i have a requirement.
i am writing a very large sp.
i have written many comments in that sp.
i wanted to generate a document from that comments i have wriiten in that sp.
i know a similar thing can be done in vb.net comments.
is it possible top do such a thing in .sql file.

ie
all comments that i have wriiten in my .sql file should be extracted.
to a document.

View 5 Replies View Related

When To Use A Joined Table For Comments?

Nov 9, 2005

I have a table with almost a million rows, although it's quite slim with just ID, date, userID, JobID etc.

Now I want to the ability to add comments to some (probably less than 1%) of those lines.

The question is whether to create a separate comments table to join to it, or to create a comments field within the existing table? The comments field would obviously default to NULL, so wouldn't bloat the table unnecessarily if I add that field (right?), and would always be selected with the row from that table, so I'm leaning towards the latter alternative.

Any thoughts, words of warning?

Thanks
Mark

View 17 Replies View Related

Is There A Way To Print Some Comments Btw Queries

Feb 7, 2007

I use sql query analyzer

/*text msg 1 :This is table A */
select * from a
/*text msg 2*: This is table B */
select * from b

I want some results in text like


This is table A
name age
jeff 28
ff 17
--------

this is table B
comid name lot
23 ie 100
34 ibm 234
---------

View 2 Replies View Related

Where To Find Comments Property

Jul 23, 2005

where in sys tables does one find field property comments.neeed to query them.tia,mcnewsxp

View 3 Replies View Related

How To Code Sql Comments Within Sql Statement

Jun 19, 2007

I want to write a query like this:

select ' select count(*) '+ '/*' + table_name + '*/' + char(10) + ' FROM '+table_name...

The result should looks like this:

--------------------------------------------
select count(*) /* ---- emp_name */
FROM emp_name


---------------------------------------------
query result:


COUNT(*)----EMP_NAME
-------------------
3

-------------------------------------------
But, now I can only got

COUNT(*)
-------------------
3


What's wrong with my original code?

View 4 Replies View Related

Comments Using Reporting Services

Mar 21, 2008

Hi


am pretty new to the reporting services...i had the requirement like user wants to add the comments in the report whenever he requires...is this possible using RS and how?

Thanks for the help in advance!!

Kumar16

View 5 Replies View Related

Export To Cvs/excel With Comments Attached

Sep 20, 2006

i'm building a web page to help our support staff run and export their sql queries faster and more easily than going through the sql server manager.  i found an article at codeproject [1] that i was able to customize to be more flexible, but i'm not sure how to get it to export the results of a query along with the comments that preceed the query.

for example, i have the following sql file: -- this query does a certain thing, and the comment can be pretty long at times, depending on how complicated the query is
select * from table where columnid > 100would anyone be able to tell me how to edit Kolluri's export function to allow for a comment section?  alternatively if his way of doing an export is out of date, i'd be interested in a newer way.  most importantly, though, i need to be able to export the comments along with query results.my ultimate goal is to have a drop down list of databases on the server, a list of query files (from a certain consolodated folder) for them to run on the chosen database, a "test query" function, and an export function that exports the comments and results.[1] http://www.codeproject.com/aspnet/ExportClassLibrary.asp 

View 1 Replies View Related

Need Suggestion Or Comments For N-Tier Applications.

Nov 30, 2006

 using System;

namespace BaResearch.Data.msSql
{
interface ISqlDataObject
{
System.Data.SqlClient.SqlConnection Connection { get; }
string ConnectionString { get; set; }
}
}

 ___________________________________using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace BaResearch.Data.msSql
{

public class SqlDataObject : ISqlDataObject
{

private string _ConnectionString;

public SqlConnection Connection
{
get { return new SqlConnection(_ConnectionString); }
}

public string ConnectionString
{
get
{
return _ConnectionString;
}
set
{
_ConnectionString = value;
}
}

}

}

 __________________________________using System;

namespace BaResearch.Data
{
interface IBid
{
string Client { get; set; }
string Contact { get; set; }
string Sponsor { get; set; }
string Priority { get; set; }
string BidStatus { get; set; }
}
}

 _____________________________________________using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace BaResearch.Data.msSql
{

public class Bid : SqlDataObject, IBid
{

#region private member & variables

private int _BidID;
private string _DateCreated;
private string _CreatedBy;

private string _Client;
private string _Contact;
private string _Sponsor;
private string _Priority;
private string _BidStatus;

private SqlDataAdapter sqlda = new SqlDataAdapter();
private SqlCommand _command;
private SqlParameter[] _parameters =
{
new SqlParameter("@client",SqlDbType.NVarChar),
new SqlParameter("@contact",SqlDbType.NVarChar),
new SqlParameter("@sponsor",SqlDbType.NVarChar),
new SqlParameter("@priority",SqlDbType.NVarChar),
new SqlParameter("@bidstatus",SqlDbType.NVarChar),
};

#endregion

#region public member variables - stored procedures

//private string sp_Create = "bids_sp_insert";
//private string sp_Update_ByID = "bids_sp_updatebyid";
//private string sp_Delete_ByID = "bids_sp_deletebyid";
//private string sp_Select_All = "bids_sp_selectall";
//private string sp_Select_ByID = "bids_sp_selectbyid";
//private string sp_Select_ByValue = "bids_sp_selectbyvalue";

#endregion

#region constructors and destructors

public Bid()
{
if (this.ConnectionString == null)
{
this.ConnectionString = ConfigurationManager.ConnectionStrings["SQL.ConnectionString"].ConnectionString;
}
else
{
new Bid(this.ConnectionString);
}
}

public Bid(string ConnectionString)
{
this.ConnectionString = ConnectionString;
}

#endregion

#region methods & events

/// <summary>
/// Attach parameters to an SqlCommand
/// </summary>
/// <param name="sqlcmd">SqlCommand</param>
private void attachparameters(SqlCommand sqlcmd)
{
sqlcmd.Parameters.Clear();
foreach (SqlParameter param in _parameters)
{
sqlcmd.Parameters.Add(param);
}
}

/// <summary>
/// Assign value to the parameters
/// </summary>
/// <param name="sqlcmd">SqlCommand</param>
/// <param name="value">Client object</param>
private void assignparametervalues(SqlCommand sqlcmd, Bid value)
{
this.attachparameters(sqlcmd);
// todo: assign parameter values here
sqlcmd.Parameters[0].Value = value.Client;
sqlcmd.Parameters[1].Value = value.Contact;
sqlcmd.Parameters[2].Value = value.Sponsor;
sqlcmd.Parameters[3].Value = value.Priority;
sqlcmd.Parameters[4].Value = value.BidStatus;
}

public virtual void Create(Bid value)
{
_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"INSERT INTO bids (client, contact, sponsor, priority, bidstatus, createdby)
VALUES (@client, @contact, @sponsor, @priority, @bidstatus, @createdby);";
_command.CommandType = CommandType.Text;

try
{
sqlda.InsertCommand = _command;
this.assignparametervalues(sqlda.InsertCommand, value);
sqlda.InsertCommand.Parameters.AddWithValue("@createdby", value.CreatedBy);
sqlda.InsertCommand.Parameters.Add("@bidid", SqlDbType.Int);
sqlda.InsertCommand.Parameters["@bidid"].Direction = ParameterDirection.ReturnValue;
sqlda.InsertCommand.Connection.Open();
sqlda.InsertCommand.ExecuteNonQuery();
sqlda.InsertCommand.Connection.Close();
sqlda.InsertCommand.Connection.Dispose();
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}

public virtual int Update(Bid value)
{
int result;

_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"UPDATE bids SET client=@client, contact=@contact, sponsor=@sponsor,
priority=@priority, bidstatus=@bidstatus
WHERE bidid=@bidid";
_command.CommandType = CommandType.Text;

try
{
sqlda.UpdateCommand = _command;
using (SqlCommand _cmd = sqlda.UpdateCommand)
{
this.assignparametervalues(_cmd, value);
_cmd.Parameters.AddWithValue("@bidid", value.BidID);
_cmd.Connection.Open();
result = _cmd.ExecuteNonQuery();
_cmd.Connection.Close();
_cmd.Connection.Dispose();
}
}
catch (Exception e)
{
throw new Exception(e.Message);
}

return result;
}

public virtual void Delete(Bid value)
{
_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"DELETE bids WHERE bidid=@bidid;";
_command.CommandType = CommandType.Text;

try
{
sqlda.DeleteCommand = _command;
using (SqlCommand _cmd = sqlda.DeleteCommand)
{
_cmd.Parameters.AddWithValue("@bidid", value.BidID);
_cmd.Connection.Open();
_cmd.ExecuteNonQuery();
_cmd.Connection.Close();
_cmd.Connection.Dispose();
}
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}

public virtual DataSet List(string filter)
{
DataSet result = new DataSet();

_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"SELECT * FROM bids_view_listall
WHERE (clientname like @value) or (contactname like @value)
or (sponsor like @value) ORDER BY datecreated DESC";
_command.CommandType = CommandType.Text;

try
{
if (filter != null)
{
filter = filter.Replace(" ", "%");
}
sqlda.SelectCommand = _command;
sqlda.SelectCommand.Parameters.AddWithValue("@value", "%" + filter + "%");
sqlda.Fill(result);
}
catch (Exception e)
{
throw new Exception(e.Message);
}

return (DataSet)result;
}

#endregion

#region IBid Members

public string Client
{
get
{
return _Client;
}
set
{
_Client = value;
}
}

public string Contact
{
get
{
return _Contact;
}
set
{
_Contact = value;
}
}

public string Sponsor
{
get
{
return _Sponsor;
}
set
{
_Sponsor = value;
}
}

public string Priority
{
get
{
return _Priority;
}
set
{
_Priority = value;
}
}

public string BidStatus
{
get
{
return _BidStatus;
}
set
{
_BidStatus = value;
}
}

#endregion

#region Properties

public int BidID
{
get
{ return _BidID; }
set
{ _BidID = value; }
}

public string DateCreated
{
get
{
return _DateCreated;
}
set
{
_DateCreated = value;
}
}

public string CreatedBy
{
get
{
return _CreatedBy;
}
set
{
_CreatedBy = value;
}
}

#endregion

}

}

 _____________________________________________
 
Am I on a right path? I will greatly appreciate in any comments or suggestions for a design. I am creating an n-tier application and i don't know if my design is right. I dont have the proper schooling for creating this kind of applications and I am still on layer of data access and business logic.

View 5 Replies View Related

Comments For Tables / Columns In SQL Sever

Jul 27, 2004

Hi,

How do I add comments to tables / columns in SQL Server ? Oracle supports adding comments to tables / columns using "comment on table / column" statement. Is a similar feature available in SQL Server 2000 ?

Any help folks ?

TIA,
Sam

View 1 Replies View Related

Help With A Maintenance Plan - Comments Needed?

Sep 12, 2007

HI

I know what sort of backup I want to accomplish with a given database, and I understand that the maintenance plans section is intelligent enough to give it to me, but I cant quite seem to configure it the way I want..

For the first week in the month I want to do a full backup every Tuesday at 7am and for the rest of the week, inc the following monday I want to append 10 min trans log backups to it. I then want to reinit and start a new backup file on the tuesday in the second week and do the same. the same thing for the next week and the next week until we get back to week one again.

so a 4 week schedule with each week dumping a full and trans log backups to its own backup set until we rotate back to week 1 again.

The schedule and the different files are the important bit. I assume I can create 4 backup objects named week1 to week4, create a job that references each one (with full and trans log backups) and then set the schedule for each job to occur weekly every 4 weeks. easy, yes?

Im just after alittle confirmation. whilst im not a numpty SQL is on a learning curve for me that I dont particulalrly want to be on... anyway.

Comments please.

Cheers

Alastair
Methodology.

"A computer once beat me at chess - but it was no match for me at kick boxing" - Emo Phillips.

View 9 Replies View Related

Data Type For Comments Field?

Mar 3, 2007

Hi,

I am using SQL Server 2005 Express. I am creating a table, which will have a comments field. Whats an appropriate data type that should be used for a "comments" field? So far, I have unlimited text and characters can be entered, but that a limitation can be placed.

 

Thanks

 

Chirs

View 1 Replies View Related

Stored Procedure Comments Performance Hit?

Apr 18, 2008

Hi, I think I remember reading somewhere that excessive comments inside a stored procedure can have a negative impact on performance. Does anyone know if this is true and can provide an explanation?

Thank You

View 6 Replies View Related

Horrible Experience With Xp_cmdshell - Your Comments Please

May 21, 2008

I had a nerve-wracking experience with xp_cmdshell today.

In SSMS, I ran a command to "cd" to a directory, then "rename" some files in that directory. I made the ignorant mistake of running the commands separately - NEVER NEVER DO THIS.

What happened was, by the time I ran the "rename" command it defaulted to the "system32" directory and started renaming files there instead... talk about !!$#*@(!-up!

Has any ever done this, or heard about this horrible experience before? I am trying to document cases of this, so that I don't look like the complete idiot that I am.

View 2 Replies View Related

Cell Comments In Excel Export

Jul 16, 2007

Is it possible to include a cell comment when exporting a report to Excel? My first guess was that the Textbox.ToolTip property might do the trick, but no luck.

Example: I am calculating a textbox based on the age of a particular value in days and conditionally formatting it. In the Excel export, I would like to have a cell comment (i.e., "insert comment" from the context menu in Excel) that shows how many days past the age limit the item is when it is formatted.

Thanks much for any help!

View 1 Replies View Related

ExecuteSQL Using Variable Expression And Comments

Nov 16, 2007

I have been successful using comments (to help remind me that the SQL is coming from a varaible which is set via an expresion) within the variable expression passed to a Source or Destination. I have been unable to get this to work in an ExecuteSQL control flow task when parameters are used within the query. I am not sure what is causing this not to work the fact that it is an ExecuteSQL control flow task or that the SQL has parameters (or perhaps that it also uses an OUTPUT parameter).

Any thoughts to share? Am I missing something?

WORKS (In Data Flow SQL):
"--NOTE: This is defined by an expression on Source_AdventureWorks_Customers_SQL variable
SELECT
[CustomerID],
[TerritoryID],
[AccountNumber],
[CustomerType],
[rowguid],
[ModifiedDate]
FROM
[AdventureWorks].[Sales].[Customer]"

FAILS (in Control Flow ExecuteSQL with parms including Output parm):
"--NOTE: This is defined by an expression on Source_AdventureWorks_Customers_SQL variable
[audit].[up_LogEtlPackageStart]
@ETLAuditParentKey = ?,
@Description = ?,
@PackageName = ?,
@PackageGuid = ?,
@PackageVersionMajor = ?,
@PackageVersionMinor = ?,
@PackageVersionBuild = ?,
@MachineName = ?,
@ExecutionGuid = ?,
@LogicalDate = ?,
@StartTime = ?,
@Operator = ?,
@ETLAuditKey = ? OUTPUT"

WORKS (in Control Flow ExecuteSQL with parms including Output parm):
"[audit].[up_LogEtlPackageStart]
@ETLAuditParentKey = ?,
@Description = ?,
@PackageName = ?,
@PackageGuid = ?,
@PackageVersionMajor = ?,
@PackageVersionMinor = ?,
@PackageVersionBuild = ?,
@MachineName = ?,
@ExecutionGuid = ?,
@LogicalDate = ?,
@StartTime = ?,
@Operator = ?,
@ETLAuditKey = ? OUTPUT"


View 7 Replies View Related







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