How do you give a column a description in SQL. I have a project where the table will created with SQL using the legacy database systems 6 byte field names. the old system (DB2/400) has field(column) descriptions that I would like to move over but how?
I know I could create a view over the table and use the more descriptive field names.. but I would like for them to be in the same table..
like emhrdt - column name (for reference to the legacy systems source code) Employee Hire Date - column descriptions (so programmers for the new system know what it means).
I wrote this quick SQL for project documentation purposes.
/* Provides Table Name, Column Name, Extended Description */ select a.name as tbl_name, b.name as column_name, d.name as data_type, d.length as length, d.xprec as prec, d.scale as scale, b.usertype, b.scale, c.value from sysobjects as a inner join syscolumns as b on a.id = b.id inner join sysproperties as c on b.colid = c.smallid and a.id = c.id inner join systypes as d on b.xtype = d.xtype
I want to select multiple records based on descriptions that are the same. Descriptions is my column and I really want to find duplicate records based on the description column.
Is there an easy way to add descriptions or comments to database objects? So, for instance, I might have a table that a number of analysts are using, and I'd like an easy way to save comments or descriptive data about each of the columns in the table. That way, all consumers of the DB can easily look up the meaning of each column, table, stored procedure, etc. I could maintain all of this information in a system separate from my RDBMS, but I'm wondering if there are existing ways to do this already built into SQL Server. I've seen something similar to this built into Oracle systems.
Hi Guys, I just need a script to get all Job Id and Job Descriptions from Sql Server Agent/Jobs and then save it into a text file. I'm not sure how to accomplish this using Sql Server Management Objects(SMO). Any sample scripts and/or stored procedures, etc. would be appreciated. Thanks for your help. -W2528
I have a requirement to set Description values for our cube dimensions and attributes.
I've done this for regular dimensions but I cant seem to find a way for role playing dimensions. I can set the base dimension descriptions but not the 'clones'. Is this possible?
The tables are what the tables are. Here is what I am trying to accomplish:
ID CODES DESCRIPTIONS -- ----------------- -------------------------------------- 01 Code1,etc Description1,Description2,Description3
I've found two different queries which return each code and associated description by ID in separate rows. Perhaps the next step is to aggregate from this?
Hi, I got a table with a column datatype BIT. I export it into RAW file destination.
When I try to import into another server the column is like DT_I4... Error 26 Validation error. Attributi: SQL Server Destination [2646]: The column "conIntervallo" can't be inserted because the conversion between types DT_I4 and DT_BOOL is not supported. IMP_Sito_Raw.dtsx 0 0
OK, this message is clean but why appends? Two table are same in all column...seems my PKG cast the column like an DT_I4?
There is some action for correct this error on import, without put on the plane an data conversion task? I do from RAW to RAW for better performance....
I've got an issue - I've got a needed query that executes fine, etc..etc...
the issue is , 1 or more columns (depending) are of TEXT data type - and by virtue of potentially poor front end data entry design - they have large strings stored in each record - much of these strings are made even larger ( in char size ) because of html being stored in the db -- from a design point of view - I blame who ever designed the CMS system that allows this --- thats neither here nor there
The issue is I need these fields and their respective "description" data. BUT I also need to export it to something usable my a marketing department.
The issue lies in that MSSQL Studio - which in grid reports the columns, values, etc..etc.. fine - upon .CVS export - INSTEAD OF TRUNCATING @ THE MAX CHAR LENGTH PER COLUMN (8126 or something) IT PUSHES THE REMAINING TEXT TO THE NEXT COLUMN.
big problem --- to be honest, I dont really need all the data - even just like 500 characters would be more then enough
my question : Is there a way to limit column return lenght @ the query level ? (NOT a truncation of table)
I have table1 with col1 varchar,col2 int , col3 xml , col4 bit ...best way to fetch the col3 into file (.txt or .sql) into seprate file for each col3 record . I want to export this in different files for each record if possible with date and time stamp .
I am trying to create a hard copy of all the table definitions in the database and have not found a way to do so. The report would have all the columns for a partcular table and each property assigned to the column. For instance Customers table has CustomerId, FirstName, LastName, Phone, etc. The CustomerId is PK, Identity, Auto Increment, BIGINT, NOT NULL. FirstName is NVARCHAR(30), NULL. LastName is NVARCHAR(30), NULL. Phone is NVARCHAR(20), NULL. Can anyone point me to the right system function or sp to get this info?
I am having DTS problem exporting from a table to a text file (my 600 character table column is truncated to 255 characters in the output text file). I don't why this is happining nor how to get the DTS not truncate to 255 characters. Is this a bug? A limitation? How do I get around this problem? .......I am running SQL Server 7 SP1 and database is in 6.5 compatability mode.
I have a request to export some table data to excel and the "notes" column (varchar 255) contains multiple lines separated by CR/LF. when I export to excel, the first record with CR/LF messes up the column alignment in excel, throwing off the format from that point on. how can i export to excel so that it preserves these CR/LF. or if not, how can I remove these characters so that excel can handle it?
Until SSMS 2012 I copy and paste grid view with header directly to Excel. Problem starts when I try to copy results from SSMS 2012 because text column copy with some format and spreads around sheet and not in only one cell. What do I have to do how to select text columns and how to copy them to excel. IN SSMS 2008 it all works OK.
we have a table with xml column. This column has a large xml data . I am trying to use ssis to import xml from sql column (table a) to destination (another table).
steps which i did in ssis:
1. execute sql task:
fetch the xml column by query and store "full result set" into an object variable.
2. foreach loop:
select Ado enumerator option and select variable which has reset set of execute sql task. In variable mapping selected a new variable of type string.
when I run package I get below error:
"Error: ForEach Variable Mapping number 1 to variable "User::variable" cannot be applied".
hi, i have a table having two column say columnA and columnB.columnA(text datatype) contains the data that is to written in a file and columnB(nvarchar datatype) contains the filepath.
but while configuring the export column tranformation, in the export column field i am getting the list of both the colums. here i am choosing columnA but in the file path name column i am not getiing the name of the column which contains the file name.
can anyone help me regarding how to configure the file path name column in export column transformation. from where we ll get the file path name.
in control flow, i have used only dataflow component and data flow tab i have used oledb source-->export column transformation-->oledb destination.
please help in configuring the export column transformation. thanks a lot !!!!!!!!!!!!!!!!!!!!!!!
As the title indicates am i searching for a method to export values of a column to a file (plain text). I have been searching on the internet about it but can't seem to find any information. I am working with Microsoft SQL Server Management Studio
The values has to come out as they are in the table meaning
aaaa ------ bbbb ------ ccc -----
to aaaa bbb ccc
I am hoping there is a method to do this by creating a script, telling what table to copy and to save it on file yyy/xxx/zzz.txt
I have a table in one of my databases that stores files in one of its columns. I need to be able to export this BLOB column into either a CSV or Excel file. I am forbidden from using xp_Cmdshell so I was wondering if there was a way to do this in the Cmd prompt.
We are experiencing problems with reporting services built-in Export to Excel. Basically, the columns get wrapped in Excel, which frustrates users who need to pivot and sort(ie the point of downloading to Excel). Is there a method for removing the column wrapping? Please help
I have a table which has few columns as Numeric value. I need to export the output into a csv file as a report with column headers. I have used bcp command. Here column name and Column Header name is the same. The BCP query which i have used is Below
I have created a DTS package that pulls data from one column (varchar,600) in a table and exports it to a text file. The max length in this field is only 285 characters long, however, the end of one of the records is being truncated in the text file. Data is tab delimited in the table and is being exported that way.
In SQL server Reporting service we need to export excel formula for summing column values. scenario : After generating report we are exporting report to excel file using report viewer.when user will modify a column value we need to calculate(update) automatically sum of the column values.Basically we are setting excel formula.
We run std 2008 r2. I'm looking at the files this transform is complaining about. They seem to be named appropriately. The customerid folders don't exist when this runs. I'm going to put one in place to see if that is the problem.
The errors i'm getting are...
[Export Column [22]] Error: The file name "c:usersmyuserid heprojectnamecustomeridafilename.doc" is not valid. The file name is a device or contains invalid characters. [Export Column [22]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "component "Export Column" (22)" failed because error code 0xC020207F occurred,
and the error row disposition on "input column "FILENAME" (29)" specifies failure on error. An error occurred on the specified object of the specified component.
There may be error messages posted before this with more information about the failure.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Export Column" (22) failed with error code 0xC0209029
while processing input "Export Column Input" (23). 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. There may be error messages posted before this with more information about the failure.
How can I Export Database with foreing Key and primary key.
Operation is that SQL2005 Management Studio/Database/Tasks/Export Data
Before Version is SQL2000 we can Selected Copy Object and data between server and then Use Default Options click checked and Select Copy Index, Copy Foreing Primary key vs vs
But this options is not found in the SQL2005 Management Studio/Database/Tasks/Export Data wizard or I can't found it.
How can I export foreing Key and primary key with SQL2005 Management Studio/Database/Tasks/Export Data wizard.