Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Thursday, March 29, 2012

Combining text data rows

I am working with a database derived from text documents.One of the tables (TEXT001) contains the text of the documents with each paragraph of each document assigned to its own row with a paragraph number in a SectionNo column.I want the entire text of each document in a single row with its own unique number (so that I can do a full text search with SQL Server 2005 that will search and return the entire document as a result).How do I combine the rows with the same DocumentID into a single row of text data?This will put the entire text content of each document in its own row.

TEXT001 table as it is

DocumentID

SectionNo

SectionText

1

1

Paragraph 1 of Document 1

1

2

Paragraph 2 of Document 1

1

3

Paragraph 3 of Document 1

2

1

Paragraph 1 of Document 2

2

2

Paragraph 2 of Document 2

New TEXT table

DocumentID

SectionText

1

Entire text of Document 1

2

Entire text of Document 2

I realize that I can use “union” to combine tables with the same data type, but that is not what I am trying to do.Ideally, there is a way to create a new table and fill it with the combined SectionText data as a batch command.If anyone can tell how to do this, I would appreciate your help.

More modestly, I tried to use the “Group By” clause to combine the SectionText data using this query:

SELECT DocumentID, SectionText FROM TEXT001

GROUP BY DocumentID

And got this error message:

Msg 8120, Level 16, State 1, Line 5

Column 'TEXT001.SectionText' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

I figured that I could not contain the SectionText data as an aggregate function since it is text data and cannot be “summed”, so I tried including it in the GROUP BY clause:

SELECT DocumentID, SectionText FROM TEXT001

GROUP BY DocumentID, SectionText

And got his error message:

Msg 306, Level 16, State 2, Line 5

The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.

Where do I go from here to accomplish my goal of combining the paragraphs of each document into one row per document?

Hi moonshadow, the following will create a stored procedure that will fullfill the requested task. run the sript, it will have only one constraint, is that i supposed that the maximum section length is hundreds of characters i.e: it will be great if you can use nvarchar instead of ntext, but if more characters are needed to be stored then comment and we will work around it.

IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'myProc' AND type = 'P')
DROP PROCEDURE myProc
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'NewText' AND type = 'U')
DROP table NewText
CREATE TABLE NewText
( DocumentID int,
Paragraph1 ntext,
)
GO
CREATE PROCEDURE myProc
AS
declare @.a int
declare @.b nvarchar(3000)
declare @.c int
DECLARE myCursor CURSOR FOR
SELECT DocumentID,SectionText FROM Text001
OPEN myCursor
FETCH NEXT FROM myCursor into @.a,@.b
WHILE @.@.FETCH_STATUS = 0
BEGIN
if @.c = @.a
update NewText set Paragraph1 = cast(Paragraph1 as nvarchar) + @.b where DocumentID = @.a
else
insert into NewText(DocumentID,Paragraph1) values (@.a,@.b)
set @.c=@.a
FETCH NEXT FROM myCursor into @.a,@.b
END
CLOSE myCursor
DEALLOCATE myCursor
select * from NewText
go
--ToCall your procedure:
execute myProc

|||

Hi Mario. Thanks for script. This is exactly what I am looking for.

I created a new query, pasted in your script, and clicked Execute.

A new table ("NewText") was created with the appropriate columns.

However the data from "Text001" was not copied to "NewText". When I open the "NewText" table, the content of the rows is "null".

As a Newbie to SQL Server, I am wondering if I should be doing something else to call the "myProc" procedure. Do I need to do another step to combine the rows from "Text001" and copy the combined data to "NewText"?

|||

yes moonshadow,

first it is great that you copied the script and started its excecution.

i am sure that it will work, but look what you will have to do:

EITHER: change the data type of SectionText from ntext to nvarchar, and then test. if you are urged to use ntext, then we can figure it out... but as a first step, just for your test, do not use ntext or at least do not use large text in your records under SectionText.

OR change the datatype of DocumentID to int.

look, the Table Text001 is like the following (i created this table upon your specifications):

CREATE TABLE [Text001] (
[DocumentID] [int] NULL ,
[SectionText] [ntext] COLLATE SQL_1xCompat_CP850_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

|||

Thanks for your patience Mario. Here is what I tried:

1. I tried to change the data type of SectionText from ntext to nvarchar but it would only allow nvarchar(50) or nvarchar(max). I chose nvarchar(max) since the SectionText contents are likely be much more than 50 characters. NewText table was created but still empty.

2. I changed the DocumentID to int with the same result as before.

What next?

|||

Mario:To simplify and make it more concrete for working with your query, I created a new database called “Practice”

In that database I ran this query based on your example to create a table called “Text001”:

CREATE TABLE [Text001] (

[DocumentID] [int] NULL ,

[SectionNo] [int] NULL ,

[SectionText] [ntext]

COLLATE SQL_1xCompat_CP850_CI_AS NULL )

ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

I put data into five rows of the table Text001 as follows:

DocumentID

SectionNo

SectionText

1

1

Blue

1

2

Red

1

3

Green

2

1

White

2

2

Black

I ran the initial query that you provided which was “executed successfully”

IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'myProc' AND type = 'P')
DROP PROCEDURE myProc
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'NewText' AND type = 'U')
DROP table NewText
CREATE TABLE NewText
( DocumentID int,
Paragraph1 ntext,
)
GO
CREATE PROCEDURE myProc
AS
declare @.a int
declare @.b nvarchar(3000)
declare @.c int
DECLARE myCursor CURSOR FOR
SELECT DocumentID,SectionText FROM Text001
OPEN myCursor
FETCH NEXT FROM myCursor into @.a,@.b
WHILE @.@.FETCH_STATUS = 0
BEGIN
if @.c = @.a
update NewText set Paragraph1 = cast(Paragraph1 as nvarchar) + @.b where DocumentID = @.a
else
insert into NewText(DocumentID,Paragraph1) values (@.a,@.b)
set @.c=@.a
FETCH NEXT FROM myCursor into @.a,@.b
END
CLOSE myCursor
DEALLOCATE myCursor
select * from NewText
go

The NewText table that was created looked like this:

DocumentID

Paragraph1

Null

Null

I think the NewText Table should have looked like this:

DocumentID

Paragraph1

1

Blue

Red

Green

2

White

Black

I am learning alot from working with this and am thankful for your help.

|||

moonshadow!can you try this please:

add the following, IN RED,

...

declare @.c int
DECLARE myCursor CURSOR FOR
SELECT DocumentID,SectionText FROM Text001
OPEN myCursor
FETCH NEXT FROM myCursor into @.a,@.b

IF @.@.FETCH_STATUS <> 0
PRINT " ERROR!"

WHILE @.@.FETCH_STATUS = 0
BEGIN
if @.c = @.a

...

test it, cos it seems it is not entering the loop, if there was no error, try to update the following line:

if @.c = @.a
update NewText set Paragraph1 = Paragraph1 + @.b where DocumentID = @.a
else...

also, replace all field datatypes in tables Text001, and NewText to nvarchar (i.e: do not use ntext)

...CREATE TABLE NewText
( DocumentID int,
Paragraph1 nvarchar(3000), or max
)...


|||

Mario:

1. I changed all "ntext" datatypes in tables Text001, and NewText to "nvarchar(max)"

2. I copied and pasted this

IF @.@.FETCH_STATUS <> 0
PRINT " ERROR!"

as you suggested and got this error message:

Msg 128, Level 15, State 1, Procedure myProc, Line 14 The name "ERROR!" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.

3. I also tried to update the following line as you suggested:

if @.c = @.a
update NewText set Paragraph1 = Paragraph1 + @.b where DocumentID = @.a
else...

but got the same error message.


|||ok moon shadow, instead of "ERROR!" just put anything, an insert statement, or a Print 1, just to check if the fetching is occuring with/without errors, just further troubleshooting|||

Mario: I tried numerous things without luck until I typed in a constant expression without the quotations:

IF @.@.FETCH_STATUS <> 0

PRINT 10

The command completed successfully but the content of the "NewText" table was still Null.

I figured 10 (or any number) is a constant expression as per the error message and should be appropriate but may not have served your purpose to see if the fetching is occurring. Any other thoughts on how to proceed?

|||

try to insert a record instead of PRINT, like the following:

IF @.@.FETCH_STATUS <> 0

insert into NewText(DocumentID,Paragraph1) values (1,'Error')

and check the NewText table

good luck

|||

Mario:

I used your new script and the "query executed successfully" but the content of the NewText table was still "null"

|||

moonshadow! run the following:

execute myProc

and then check the result in NewTable

|||

Mario: Yes!! The NewText table is now filled with the combined data. I told you I was a Newbie.

Perhaps you can help me with one refinement. The data in the NewNext table SectionText column is run together (ie., "blueredgreen") which will not work too well with the paragraphs in my original database. Is there a way to automatically format the new data fields (in NewText) so that each row of the original table (Text001) remains on its own line with a space between paragraphs when it is read in an application? Such as this:

blue

red

green

Thanks for your patience and knowledge in getting this far.

|||

Great MoonShadow!!!

now you've got the concept, you can expand it as you like...

regarding your concern, you can add a carriage return while filling each paragraph, i.e: add what is in red to the sql script:

...

update NewText set Paragraph1 = Paragraph1 + char(13)+char(10) + @.b where DocumentID = @.a
...

good luck

Combining Text and value in Trigger

Hi,

I have written a trigger that emails a specified person.

I am trying to include a body of the email which comprises of the stock level and a warning. Pulling out my hair...Help

Code so far in the trigger is :

CREATE TRIGGER Warnings ON [dbo].[tbl_sql_cartridges_kh]
for update
AS
declare @.SL as int
declare @.SS as int
declare @.Msg as nvarchar(100)
set @.SL= (select stock_level from inserted)
set @.SS =(select cartridge_key from inserted)
set @.Msg = 'Print Cartridges Level Warning'
if @.SL < 3
begin

exec sp_send_cdontsmail 'Print-Cartridges','XXX@.XXXX.co.uk','Print Cartridges Level Warning',@.Msg
end

I would like the @.Msg to say something like Cartridge XXX stock level is YYY, where XXX and YYY are taken from the table after update. I can get the values, but cant put them in the MSG string..

Like @.msg & @.SL (SL being Stock Level)

Many Thanks

KenFirst problem you have is that you are treating the virtual tables as if they have only 1 row...inserted may have n rows, so

set @.SL= (select stock_level from inserted)

Would only return the last results...

Second, sending emails from a trigger is very messy. Why not just do it from a stored procedure? If all the code is isolated to sproc calls then you're golden. If you allow dynamic sql from code, then it's a problem...

As for the email, we a notus lotes so we're hosed here...|||This calls a stored procedure.

The trigger will only ever have 1 row as this Sql dbase has adreamweaver front end that only lets a singke line be updated.

I can grab any items that have been updated, I just cant combine them.

I have made sure all constraints are working..

It actually tells you @.SS will be cartridge HP045a for example and @.SL could 1.

I need the @.msg to say something like Cartridge HP045a stock level is now 1.

The Cdonts procedure is effective and uses SMTP and works well..

Sunday, March 25, 2012

Combining many records into 1

Using SQL 2000, how can you combine multiple records into 1?
The source data is varchar(255), the destination will be text. I need help
with the select statement.

example tables:
CREATE TABLE [NoteHeader] (
[NoteID] [int],
[CustomerID] [int] ,
[Desc1] [varchar] (255),
[Date] [datetime] ,
)
GO

CREATE TABLE [NoteDetail] (
[NoteId] [int],
[SeqNum] [int] NOT NULL ,
[Note1] [varchar] (255),
[Note2] [varchar] (255),
[Note3] [varchar] (255),
[Note4] [varchar] (255),
[Note5] [varchar] (255)
)
GO

Sample script joining tables:
SELECT *
FROM NoteHeader INNER JOIN
NoteDetail ON NoteHeader.NoteID = NoteDetail.NoteId

Sample results:
NoteID CustomerID Desc1 Date
Note1 Note2
....Note5
1111 987 Note Header Description 2007-07-15
Notes detail record 1 field 1 Notes detail record 1 field2 ....
1111 987 Note Header Description 2007-07-15
Notes detail record 2 field 1 Notes detail record 2 field 2

Desired results:
NoteID CustomerID Desc1 Date
CombinedNotes
1111 987 Note Header Description 2007-07-15
Notes detail record 1 field 1 +

Notes detail record 1 field2 +

Notes detail record 2 field 1 +

Notes detail record 2 field 2 +

through unlimited number of records up to 5
fields each

The NoteID field is the unique number. 1 record per NoteID in NoteHeader,
NoteDetail can have unlimited number of same NoteID (usually not more than
10)rdraider (rdraider@.sbcglobal.net) writes:

Quote:

Originally Posted by

Using SQL 2000, how can you combine multiple records into 1?
The source data is varchar(255), the destination will be text. I need
help with the select statement.


SQL Server MVP Anith Sen as a couple of methods on
http://www.projectdmx.com/tsql/rowconcatenate.aspx.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||rdraider (rdraider@.sbcglobal.net) writes:

Quote:

Originally Posted by

Thanks for the info. My problem is the resulting data will be too large
for varchar(8000). All these examples seem to use varchar(8000)
I need to convert to a text datatype. I can concat multiple varchar fields
from 1 record into text but the problem is how the source data is
structured.
The source data is from an app called 'Onyx' running SQL 6.5 (I'm naming
names !!). I upgraded the SQL 6.5 to SQL 2000. I don't hav SQL 2005.


I think you have two options:

1) Get SQL 2005.
2) Do it client-side.

I think you can do it on SQL 2000, but then you would have to run
a cursor, and use WRITETEXT and UPDATETEXT and it would be very very
painful. Please don't ask me to write the code for you, but if you
have problems with using WRITETEXT and UPDATETEXT, I can try to assist.

Quote:

Originally Posted by

I assume it was designed this way because SQL 6.5 largest data type was
varchar(255) ?


Yes, that is correct.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspxsqlsql

Combining full text search results with index server/service

I have a solutions database that I'm setting up Full text search on. Part of
the "solutions" is a huge folder of attachments on the lan.
I've done both FTS alone and also Index server alone.
Are there any whitepapers or good websites that talk about combining the
two? I'd like to conduct the searches via sql server - ideally expanding the
full text index to include the content of the files on the lan.
- Jack
Please refer to the above post.
There is no white paper per se focusing on this. However you might want to
check out this paper which does touch on it.
http://msdn.microsoft.com/library/de...filedatats.asp
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"jack" <jack@.discussions.microsoft.com> wrote in message
news:10938D81-5E92-483F-ABC1-208DDF331112@.microsoft.com...
> I have a solutions database that I'm setting up Full text search on. Part
of
> the "solutions" is a huge folder of attachments on the lan.
> I've done both FTS alone and also Index server alone.
> Are there any whitepapers or good websites that talk about combining the
> two? I'd like to conduct the searches via sql server - ideally expanding
the
> full text index to include the content of the files on the lan.
> - Jack

Tuesday, March 20, 2012

combine text field with ntext field

select textfield + N'-' + ntextfield as myfield from tbl
results with error
how i can combine text field with ntext field ?
thanksHi
+ is not a valid operator when using ntext. Your result could be 4GB wide,
make sure that it is necessarily to have datatypes this large.
John
"Sam" <focus10@.zahav.net.il> wrote in message
news:uGlE%238buFHA.3792@.TK2MSFTNGP10.phx.gbl...
> select textfield + N'-' + ntextfield as myfield from tbl
> results with error
> how i can combine text field with ntext field ?
> thanks
>|||Hi,
See the old post from Aaron:-
http://groups.google.com/group/micr...c0c3714d2c912a9
Thanks
Hari
SQL Server MVP
"Sam" <focus10@.zahav.net.il> wrote in message
news:uGlE%238buFHA.3792@.TK2MSFTNGP10.phx.gbl...
> select textfield + N'-' + ntextfield as myfield from tbl
> results with error
> how i can combine text field with ntext field ?
> thanks
>sqlsql

Combine text columns

I have 2 text data type columns that I would like to combine into a new column. I'd also like to add a newline character between each column value when I combine them.

I've tried columnA + columnB but that didn't work.

How could I do that?

Hi,

you can do it like this

select columnA + ' ' + columnB as columnAB from tableX

Grz, Kris.

|||

Here's the error that it produces:

Msg 402, Level 16, State 1, Line 1

The data types text and varchar are incompatible in the add operator.

|||

In that case you need to cast the varchar to type text. You can do that by using the Transact-SQL functionCAST.

Grz, Kris.

Monday, March 19, 2012

combine fields and text in select statement

Is it possible to combine fields and text in a select statement?

In a dropDownList I want to show a combination of two different fields, and have the value of the selected item come from a third field. So, I thought I could maybe do something like this:

SELECT DISTINCT GRPAS GroupName, "Year: " +YEAR + "Grade: " + GRDAS ShowMeFROM GE_DataWHERE (DIST = @.DIST)

I hoped that would take the values in YEAR and GRD and concatenate them with the other text. Then my dropDownList could show the ShowMe value and have the GroupName as the value it passes on. However, when I test this in the VS Query Builder, it says that Year and Grade are unknown column names and changes the double-quotes to square brackets.

If this is possible, or there's a better way to do it, I'd love some more info.

Thanks!

-Mathminded

You could do it in the SELECT statement. This kind of formatting is generally done at the application/GUI layer. You need to use single quotes for strings. Also Year is a keyword so you use square brackets.

SELECT DISTINCT GRPAS GroupName, 'Year: ' + [YEAR] + 'Grade: ' + [GRD]AS ShowMeFROM GE_DataWHERE (DIST = @.DIST)

|||

I got it to work! On a whim I decided to try single quotes and that got me farther. The error it produced then led me to this page:

http://weblogs.foxite.com/andykramek/archive/2005/09/18/921.aspx

Then I realized I needed to change the type for one of the columns. Thus, I ended up with this SQL statement which works:

SELECT DISTINCT GRPAS GroupName,'Year: ' +YEAR +' and Grade: ' +CAST(GRDAS CHAR(2))AS ShowMeFROM GE_DataWHERE (DIST = @.DIST)
|||

ndinakar:

You could do it in the SELECT statement. This kind of formatting is generally done at the application/GUI layer. You need to use single quotes for strings. Also Year is a keyword so you use square brackets.

SELECT DISTINCT GRPAS GroupName, 'Year: ' + [YEAR] + 'Grade: ' + [GRD]AS ShowMeFROM GE_DataWHERE (DIST = @.DIST)

Thanks, Dinakar! I thought I had figured it out quickly but you had it even faster! :-) Thanks for pointing out the keyword issue, also.

|||

The output from my working statement is:

GroupName ShowMe

AYear: 0203 and Grade: 3AYear: 0304 and Grade: 4AYear: 0405 and Grade: 5BYear: 0203 and Grade: 4BYear: 0304 and Grade: 5BYear: 0405 and Grade: 6CYear: 0203 and Grade: 5CYear: 0304 and Grade: 6CYear: 0405 and Grade: 7DYear: 0203 and Grade: 6DYear: 0304 and Grade: 7DYear: 0405 and Grade: 8EYear: 0203 and Grade: 7EYear: 0304 and Grade: 8EYear: 0405 and Grade: 9FYear: 0203 and Grade: 8FYear: 0304 and Grade: 9FYear: 0405 and Grade: 10GYear: 0203 and Grade: 9GYear: 0304 and Grade: 10GYear: 0405 and Grade: 11

With the way my dropDownList is working, the user could select any of the first 3 choices, for instance, and end up with the same group. It would really be great if I could get this to output a single GroupName and combine the other information. For instance:

GroupName ShowMe

A Years: 0203,0304,0405 and Grades: 3,4,5

B Years: 0203,0304,0405 and Grades 4,5,6

etc...

Would that be really difficult to do? I may play around with it and see if I can get it using embeded select statements. I've never tried those before. In the off chance that I'm successful, I'll post my results. :-)

|||Again, this is the task that has to be done in the application layer. You have more string functions available in .NET to manipulate the strings than in SQL Server.|||

I thought it may make things easier if I changed how the information was displayed. Rather than try to fit all that info into the dropDownList using some complicated SQL query, I'd like to create a table with columns Group, Years, and Grades so the users can refer to that when choosing just the group letter from the dropDownList. Here's a sample of the table I'd like to display to the users:

GROUP

YEARS

GRADES

A

0203, 0304, 0405

3, 4, 5

B

0203, 0304, 0405

4, 5, 6

C

0203, 0304, 0405

5, 6, 7

D

0203, 0304, 0405, 0506

6, 7, 8, 9

The database table has the data stored like this:

GRP

YEAR

GRD

A

0203

3

A

0304

4

A

0405

5

B

0203

4

B

0304

5

B

0405

6

C

0203

5

C

0304

6

C

0405

7

D

0203

6

D

0304

7

D

0405

8

D

0506

9

I've tried a bunch of different things with the GridView in Visual Studio but I'm not meeting with success. Any advice would be appreciated.

Thanks!

-Mathminded

|||

You can create a stored proc and a local table variable in it, get the values in the format you want into the table and do a select from the table at the end.

Check if this post helps in the concatenation:http://forums.asp.net/thread/1514443.aspx

Thursday, March 8, 2012

columns in full text query

Hi
Is there a system query that tells me which columns are a fulltext index for
a particular catalog?
Cheers
James
you could try sp_help_fulltext_columns in a full text enabled database which
will tell you all the tables and the columns in these tables which are being
full text indexed.
Or you could use sp_help_fulltext_tables_cursor and pass it the catalog name
and then iterate the results set as illustrated below. In the below example
the catalog name is test.
USE pubs
GO
DECLARE @.mycursor CURSOR
EXEC sp_help_fulltext_tables_cursor @.mycursor OUTPUT, 'test'
FETCH NEXT FROM @.mycursor
WHILE (@.@.FETCH_STATUS <> -1)
BEGIN
FETCH NEXT FROM @.mycursor
END
CLOSE @.mycursor
DEALLOCATE @.mycursor
GO
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"James Brett" <james.brett@.unified.co.uk> wrote in message
news:%23WqhRpGsEHA.3712@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a system query that tells me which columns are a fulltext index
for
> a particular catalog?
> Cheers
> James
>

columns in full text query

Hi
Is there a system query that tells me which columns are a fulltext index for
a particular catalog?
Cheers
JamesFrom the BOL:
sp_help_fulltext_columns
Returns the columns designated for full-text indexing.
Rick Sawtell
MCT, MCSD, MCDBA
"James Brett" <james.brett@.unified.co.uk> wrote in message
news:uZCdpjGsEHA.1272@.TK2MSFTNGP09.phx.gbl...
> Hi
> Is there a system query that tells me which columns are a fulltext index
for
> a particular catalog?
> Cheers
> James
>

columns in full text query

Hi
Is there a system query that tells me which columns are a fulltext index for
a particular catalog?
Cheers
JamesFrom the BOL:
sp_help_fulltext_columns
Returns the columns designated for full-text indexing.
Rick Sawtell
MCT, MCSD, MCDBA
"James Brett" <james.brett@.unified.co.uk> wrote in message
news:uZCdpjGsEHA.1272@.TK2MSFTNGP09.phx.gbl...
> Hi
> Is there a system query that tells me which columns are a fulltext index
for
> a particular catalog?
> Cheers
> James
>

Column-conscious bulk insert

I am trying to bulk insert a text file. The file has fixed-length fields
with no field terminators. BOL says that field terminators are only
needed when the data does *not* contain fixed-length fields, which
implies they are optional -- so I made a format file without any (two
consecutive tabs with nothing between them). The following message
resulted:

Server: Msg 4827, Level 16, State 1, Line 1
Could not bulk insert. Invalid column terminator for column number
1 in format file

That sounds like I am required to have some sort of terminator in the
format file, even though there aren't any in the data file. Unfortunately,
the documentation on bcp/bulk copy and format files does not directly
address this point, and I would appreciate some help.

BTW, putting '""' (empty string) for the terminator also leads to errors,
with the first field overflowing -- bulk insert can't figure out where
it ends.

Thanks,
Jim Geissman
Countrywide Home Loansjim_geissman@.countrywide.com (Jim Geissman) wrote in message news:<b84bf9dc.0401281622.34aa0e42@.posting.google.com>...
> I am trying to bulk insert a text file. The file has fixed-length fields
> with no field terminators. BOL says that field terminators are only
> needed when the data does *not* contain fixed-length fields, which
> implies they are optional -- so I made a format file without any (two
> consecutive tabs with nothing between them). The following message
> resulted:
> Server: Msg 4827, Level 16, State 1, Line 1
> Could not bulk insert. Invalid column terminator for column number
> 1 in format file
> That sounds like I am required to have some sort of terminator in the
> format file, even though there aren't any in the data file. Unfortunately,
> the documentation on bcp/bulk copy and format files does not directly
> address this point, and I would appreciate some help.
> BTW, putting '""' (empty string) for the terminator also leads to errors,
> with the first field overflowing -- bulk insert can't figure out where
> it ends.
> Thanks,
> Jim Geissman
> Countrywide Home Loans

Jim,

Just a thought, but have you tried using the "-c" flag with the BCP IN
command instead of using a format file? Create a target table where
the column widths exactly match the fields in your file, and give it a
try. ("-c" takes no parameters). Assuming you've got record
terminators in the correct place, I think this should work.
Personally, I hate using format files and avoid them like the plague
if I can.

bcp <db>..<target_tbl> in <datafile> -Uuser -Ppass -Sserver -c

Phil|||Thanks, Phil.

I wish that were true. However it seems that -c assumes \t (tab)
separators. At least it doesn't work. Putting in -t (specify separator
but don't provide one) causes bcp to just sit there and do nothing.
I'm going to use DTS and specify column by column where they all end.
It's such a waste of effort, though, because the data is from the Census
and the input exactly matches the table, character by character.

Thanks again
Jim

> Jim,
> Just a thought, but have you tried using the "-c" flag with the BCP IN
> command instead of using a format file? Create a target table where
> the column widths exactly match the fields in your file, and give it a
> try. ("-c" takes no parameters). Assuming you've got record
> terminators in the correct place, I think this should work.
> Personally, I hate using format files and avoid them like the plague
> if I can.
> bcp <db>..<target_tbl> in <datafile> -Uuser -Ppass -Sserver -c
> Phil|||Jim Geissman (jim_geissman@.countrywide.com) writes:
> I am trying to bulk insert a text file. The file has fixed-length fields
> with no field terminators. BOL says that field terminators are only
> needed when the data does *not* contain fixed-length fields, which
> implies they are optional -- so I made a format file without any (two
> consecutive tabs with nothing between them). The following message
> resulted:
> Server: Msg 4827, Level 16, State 1, Line 1
> Could not bulk insert. Invalid column terminator for column number
> 1 in format file
> That sounds like I am required to have some sort of terminator in the
> format file, even though there aren't any in the data file.
> Unfortunately, the documentation on bcp/bulk copy and format files does
> not directly address this point, and I would appreciate some help.

You must specify the separator in quotes, but it can be the empty
string, "". The tabs does not mean anything to BCP, as far as I know.
At least it never complain about lack of tabs in my format files.

>BTW, putting '""' (empty string) for the terminator also leads to errors,
>with the first field overflowing -- bulk insert can't figure out where
>it ends.

What about posting:

o CREATE TABLE statement for your table.
o The format file. (The one with "" in it.)
o A sample file to bulk-load.

That makes it a little easier to have a guess of what is going on.

If the data file is more than 75 characters wide, you are probably
better of putting it an attachment.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Wednesday, March 7, 2012

Column Row Delimeter Problem

I'm trying to import a comma delimited text file into a SQL table-

The row delimiters I am assuming are {CR}{LF}

When I try to open up my file in Excel, the data file parses perfectly.

When I try to port it over in SSIS, I get an error:

"The column delimeter for column <my column> was not found."

"An error occurred while processing the file <my file> on data row 2076"

I've tried looking at that data row, and i am having a hard time finding anything wrong with the row.

Anybody know of any good ways to debug that?

n/m- I figured out my problem- the data was buggy- it had dual double-quotations- yet the double-quotations are what signified text qualifiers- and SSIS was not correctly picking up the text qualifiers correctly.

How do you get SSIS to understand quotes if the text qualifier is a quote?

Saturday, February 25, 2012

Column Names of Fulltext search result

I was trying to do full text search. I have no problem to do the search as
following:
select MemberID, Surname, Firstname from members where FREETEXT(*, N'moore')
It returned all rows for any column containing values that match the
meaning, but not the exact wording, of the text 'moore'.
My problem is that my client want to know the name(s) of the column(s) which
the keyword 'moore' was found. How can I get the required info?
And I also tried FREETEXTTABLE, which only returns a relevance ranking value
(RANK) and full-text key (KEY) for each row. Same things using CONTAINS or
CONTAINSTABLE
Thanks in advance.
To get an exact search, ie moore, but not moores wrap your freetext search
in double quotes or use contains, ie
select MemberID, Surname, Firstname from members where FREETEXT(*,
N'"moore"')
You can't easily get the column where the hit occurs. You would have to do
something like this
create table members(MemberID int identity not null, surname varchar(20),
firstname varchar(20), constraint memberspk primary key (memberid))
GO
insert into members(surname, firstname) values('moore','moore')
insert into members(surname, firstname) values('moore','dave')
insert into members(surname, firstname) values('dave','moore')
insert into members(surname, firstname) values('dave','dave')
GO
sp_fulltext_database 'enable'
GO
create fulltext index on members(surname, firstname) key index memberspk
GO
select *, case
when charindex('moore',surname)>0 and charindex('moore',firstname)=0 then
'surname'
when charindex('moore',surname)=0 and charindex('moore',firstname)>0 then
'Firstname'
when charindex('moore',surname)>0 and charindex('moore',firstname)>0 then
'both'
else 'not sure'
end From members where contains(*,'moore')
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"X. Zhang" <XZhang@.discussions.microsoft.com> wrote in message
news:5C88126C-FC9F-4281-BAA7-7FC3AAE2E0BD@.microsoft.com...
>I was trying to do full text search. I have no problem to do the search as
> following:
> select MemberID, Surname, Firstname from members where FREETEXT(*,
> N'moore')
> It returned all rows for any column containing values that match the
> meaning, but not the exact wording, of the text 'moore'.
> My problem is that my client want to know the name(s) of the column(s)
> which
> the keyword 'moore' was found. How can I get the required info?
> And I also tried FREETEXTTABLE, which only returns a relevance ranking
> value
> (RANK) and full-text key (KEY) for each row. Same things using CONTAINS or
> CONTAINSTABLE
> Thanks in advance.
|||Hilary,
Thank you for your reply. I thought about this way too, but I have problem
with it. I had more than 50 columns to be searched, which means I have to
'when' more than 50 times, actually lots more than 50 times if I need the
column combinations, such as your 'both' case.
I was wondering if there is a straight forward way to do so. If no, I guess
I have to do some programming...
Thanks,
"Hilary Cotter" wrote:

> To get an exact search, ie moore, but not moores wrap your freetext search
> in double quotes or use contains, ie
> select MemberID, Surname, Firstname from members where FREETEXT(*,
> N'"moore"')
> You can't easily get the column where the hit occurs. You would have to do
> something like this
> create table members(MemberID int identity not null, surname varchar(20),
> firstname varchar(20), constraint memberspk primary key (memberid))
> GO
> insert into members(surname, firstname) values('moore','moore')
> insert into members(surname, firstname) values('moore','dave')
> insert into members(surname, firstname) values('dave','moore')
> insert into members(surname, firstname) values('dave','dave')
> GO
> sp_fulltext_database 'enable'
> GO
> create fulltext index on members(surname, firstname) key index memberspk
> GO
> select *, case
> when charindex('moore',surname)>0 and charindex('moore',firstname)=0 then
> 'surname'
> when charindex('moore',surname)=0 and charindex('moore',firstname)>0 then
> 'Firstname'
> when charindex('moore',surname)>0 and charindex('moore',firstname)>0 then
> 'both'
> else 'not sure'
> end From members where contains(*,'moore')
>
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "X. Zhang" <XZhang@.discussions.microsoft.com> wrote in message
> news:5C88126C-FC9F-4281-BAA7-7FC3AAE2E0BD@.microsoft.com...
>
>
|||You could also limit your FT query to a certain column.
For example
select MemberID, Surname, Firstname from members where
contains(surname,'moore')
and do the same for every fulltext indexed column in your table and then
combine the results.
Thanks
"X. Zhang" wrote:
[vbcol=seagreen]
> Hilary,
> Thank you for your reply. I thought about this way too, but I have problem
> with it. I had more than 50 columns to be searched, which means I have to
> 'when' more than 50 times, actually lots more than 50 times if I need the
> column combinations, such as your 'both' case.
> I was wondering if there is a straight forward way to do so. If no, I guess
> I have to do some programming...
> Thanks,
> "Hilary Cotter" wrote:

Friday, February 24, 2012

Column metadata from Connection Manager programmatically

Hi all!

My problem I've been struggling with is the following. I have a set of text files (around 70), each with different column numbers and types. I define Flat File Connection Managers for each of them where I can nicely rename, set data types and omit certain columns. I do this once and this will be the basis for the rest of the data process (would be nice programmatically too actually).
I would like to pump each of these text files into SQL Server tables using CREATE TABLE and BULK INSERT (because do it one-by-one is really a pain). The question is:

is there a way to obtain column information (Script Task) from a Connection Manager so I can run CREATE TABLE-s? I just need the names, data type for each nothing fancy...

(I bumped into interfaces like IDTSConnectionManagerFlatFileColumns90, which I cannot handle from the Script Task.)

Any help appreciated!

What your asking is a design-time action, not run-time, and could be done if you load the package and walk round the object model. If using BULK INSERT, then why bother with SSIS Flat File Connections at all?|||

Thanks for the answer. That is exactly I cannot achieve:

Dim mgr As ConnectionManager = Dts.Connections(1)
Dim o As Object = mgr.Properties("Columns").GetValue(mgr)

This returns something (COM IDTSConnectionManagerFlatFileColumns90?) that I cannot handle more. Or am I on the wrong track? Do I need more assemblies and references?

The other question: I've found it very comfortable to define flat file structure using Flat File Connections (UI, data types). On the other hand I need a CREATE TABLE based on a flat file structure. Other ideas maybe?

|||

What I said was that this was probably not the right way to do this. The Script task is using run-time.

If you try and use IDTSConnectionManagerFlatFileColumns90 then you will need another reference. Just look it up in Books Online and it wiull tell you that it is in the Microsoft.SqlServer.DTSRuntimeWrap assembly, so add this reference.

Dim conn As ConnectionManager = Dts.Connections(0)

Dim o As Object = conn.Properties("Columns").GetValue(conn)

Dim xx As Wrapper.IDTSConnectionManagerFlatFileColumns90 = CType(o, Wrapper.IDTSConnectionManagerFlatFileColumns90)

Dim dt As Wrapper.DataType = xx.Item(0).DataType

Dim w As Integer = xx.Item(0).MaximumWidth

The above code seems to work.

|||

Hi darren, how do you get the column name? The Wrapper.IDTSConnectionManagerFlatFileColumns90 doesn't have any 'name' member.

Also, i'm trying to do the reverse of this process, which is to add columns to the connection programmatically? How do i go about this?

I've come as close as getting adding the column into the wrapper.idtsconnectionmanagerflatfilecolumns90 collection, but i have no way of adding a 'name' to it? How do i do that? Here's my code:

dim conn2 as idtsconnectionmanager90 = pkg.connections("FlatFileConn").value

Dim conn3 As Wrapper.IDTSConnectionManagerFlatFile90 = CType(conn2.InnerObject, Wrapper.IDTSConnectionManagerFlatFile90)

Dim mynewcol1 As Wrapper.IDTSConnectionManagerFlatFileColumn90

mynewcol1 = conn3.Columns.Add

mynewcol1.DataType = Wrapper.DataType.DT_BOOL

mynewcol1.ColumnDelimiter = "~"

'<< This is where i can't add the 'name' >>

Some code would be really helpful.

Thanks.

|||

Try the following code after you add the mynewcol1

Dim name As Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSName90

name = TryCast(mynewcol1, Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSName90)

name.Name = "ColumnName"

Column metadata from Connection Manager programmatically

Hi all!

My problem I've been struggling with is the following. I have a set of text files (around 70), each with different column numbers and types. I define Flat File Connection Managers for each of them where I can nicely rename, set data types and omit certain columns. I do this once and this will be the basis for the rest of the data process (would be nice programmatically too actually).
I would like to pump each of these text files into SQL Server tables using CREATE TABLE and BULK INSERT (because do it one-by-one is really a pain). The question is:

is there a way to obtain column information (Script Task) from a Connection Manager so I can run CREATE TABLE-s? I just need the names, data type for each nothing fancy...

(I bumped into interfaces like IDTSConnectionManagerFlatFileColumns90, which I cannot handle from the Script Task.)

Any help appreciated!

What your asking is a design-time action, not run-time, and could be done if you load the package and walk round the object model. If using BULK INSERT, then why bother with SSIS Flat File Connections at all?|||

Thanks for the answer. That is exactly I cannot achieve:

Dim mgr As ConnectionManager = Dts.Connections(1)
Dim o As Object = mgr.Properties("Columns").GetValue(mgr)

This returns something (COM IDTSConnectionManagerFlatFileColumns90?) that I cannot handle more. Or am I on the wrong track? Do I need more assemblies and references?

The other question: I've found it very comfortable to define flat file structure using Flat File Connections (UI, data types). On the other hand I need a CREATE TABLE based on a flat file structure. Other ideas maybe?

|||

What I said was that this was probably not the right way to do this. The Script task is using run-time.

If you try and use IDTSConnectionManagerFlatFileColumns90 then you will need another reference. Just look it up in Books Online and it wiull tell you that it is in the Microsoft.SqlServer.DTSRuntimeWrap assembly, so add this reference.

Dim conn As ConnectionManager = Dts.Connections(0)

Dim o As Object = conn.Properties("Columns").GetValue(conn)

Dim xx As Wrapper.IDTSConnectionManagerFlatFileColumns90 = CType(o, Wrapper.IDTSConnectionManagerFlatFileColumns90)

Dim dt As Wrapper.DataType = xx.Item(0).DataType

Dim w As Integer = xx.Item(0).MaximumWidth

The above code seems to work.

|||

Hi darren, how do you get the column name? The Wrapper.IDTSConnectionManagerFlatFileColumns90 doesn't have any 'name' member.

Also, i'm trying to do the reverse of this process, which is to add columns to the connection programmatically? How do i go about this?

I've come as close as getting adding the column into the wrapper.idtsconnectionmanagerflatfilecolumns90 collection, but i have no way of adding a 'name' to it? How do i do that? Here's my code:

dim conn2 as idtsconnectionmanager90 = pkg.connections("FlatFileConn").value

Dim conn3 As Wrapper.IDTSConnectionManagerFlatFile90 = CType(conn2.InnerObject, Wrapper.IDTSConnectionManagerFlatFile90)

Dim mynewcol1 As Wrapper.IDTSConnectionManagerFlatFileColumn90

mynewcol1 = conn3.Columns.Add

mynewcol1.DataType = Wrapper.DataType.DT_BOOL

mynewcol1.ColumnDelimiter = "~"

'<< This is where i can't add the 'name' >>

Some code would be really helpful.

Thanks.

|||

Try the following code after you add the mynewcol1

Dim name As Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSName90

name = TryCast(mynewcol1, Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSName90)

name.Name = "ColumnName"

Column metadata from Connection Manager programmatically

Hi all!

My problem I've been struggling with is the following. I have a set of text files (around 70), each with different column numbers and types. I define Flat File Connection Managers for each of them where I can nicely rename, set data types and omit certain columns. I do this once and this will be the basis for the rest of the data process (would be nice programmatically too actually).
I would like to pump each of these text files into SQL Server tables using CREATE TABLE and BULK INSERT (because do it one-by-one is really a pain). The question is:

is there a way to obtain column information (Script Task) from a Connection Manager so I can run CREATE TABLE-s? I just need the names, data type for each nothing fancy...

(I bumped into interfaces like IDTSConnectionManagerFlatFileColumns90, which I cannot handle from the Script Task.)

Any help appreciated!

What your asking is a design-time action, not run-time, and could be done if you load the package and walk round the object model. If using BULK INSERT, then why bother with SSIS Flat File Connections at all?|||

Thanks for the answer. That is exactly I cannot achieve:

Dim mgr As ConnectionManager = Dts.Connections(1)
Dim o As Object = mgr.Properties("Columns").GetValue(mgr)

This returns something (COM IDTSConnectionManagerFlatFileColumns90?) that I cannot handle more. Or am I on the wrong track? Do I need more assemblies and references?

The other question: I've found it very comfortable to define flat file structure using Flat File Connections (UI, data types). On the other hand I need a CREATE TABLE based on a flat file structure. Other ideas maybe?

|||

What I said was that this was probably not the right way to do this. The Script task is using run-time.

If you try and use IDTSConnectionManagerFlatFileColumns90 then you will need another reference. Just look it up in Books Online and it wiull tell you that it is in the Microsoft.SqlServer.DTSRuntimeWrap assembly, so add this reference.

Dim conn As ConnectionManager = Dts.Connections(0)

Dim o As Object = conn.Properties("Columns").GetValue(conn)

Dim xx As Wrapper.IDTSConnectionManagerFlatFileColumns90 = CType(o, Wrapper.IDTSConnectionManagerFlatFileColumns90)

Dim dt As Wrapper.DataType = xx.Item(0).DataType

Dim w As Integer = xx.Item(0).MaximumWidth

The above code seems to work.

|||

Hi darren, how do you get the column name? The Wrapper.IDTSConnectionManagerFlatFileColumns90 doesn't have any 'name' member.

Also, i'm trying to do the reverse of this process, which is to add columns to the connection programmatically? How do i go about this?

I've come as close as getting adding the column into the wrapper.idtsconnectionmanagerflatfilecolumns90 collection, but i have no way of adding a 'name' to it? How do i do that? Here's my code:

dim conn2 as idtsconnectionmanager90 = pkg.connections("FlatFileConn").value

Dim conn3 As Wrapper.IDTSConnectionManagerFlatFile90 = CType(conn2.InnerObject, Wrapper.IDTSConnectionManagerFlatFile90)

Dim mynewcol1 As Wrapper.IDTSConnectionManagerFlatFileColumn90

mynewcol1 = conn3.Columns.Add

mynewcol1.DataType = Wrapper.DataType.DT_BOOL

mynewcol1.ColumnDelimiter = "~"

'<< This is where i can't add the 'name' >>

Some code would be really helpful.

Thanks.

|||

Try the following code after you add the mynewcol1

Dim name As Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSName90

name = TryCast(mynewcol1, Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSName90)

name.Name = "ColumnName"

Column in contains clause?

Dear all,
Another question: I would like to get an overview of how often a number
of words, stored in a table KO, occur in a full text indexed column on
another table. I can do this seperately:
select * from names
id | name
--+--
1 | bush
2 | kerry
select count(*) from texts where contains(text, 'bush')
2,123
select count(*) from texts where contains(text, 'dean')
1,326
[numbers entiry fictional]
But since I have a large number of such names, I would like to just
join the count per name to the names table like so:
select name, count(*) from
names n, texts t
where contains(text, n.name)
group by name
but this returns an 'incorrect syntax near n'.
Why doesn't the above work? Is what I am trying to do possible using
the contains function? Is there another way to achieve this goal?
Thanks!
Wouter
It doesn't work because the Contains operator is expecting a single value
instead of a column - which is what you are passing.
I think what you need to do is something like this you might want to write a
cursor or perhaps a function that will return a table variable to accomplish
this.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"wouter" <wouter@.2at.nl> wrote in message
news:1108297074.753022.57670@.l41g2000cwc.googlegro ups.com...
> Dear all,
> Another question: I would like to get an overview of how often a number
> of words, stored in a table KO, occur in a full text indexed column on
> another table. I can do this seperately:
> select * from names
> id | name
> --+--
> 1 | bush
> 2 | kerry
> select count(*) from texts where contains(text, 'bush')
> 2,123
> select count(*) from texts where contains(text, 'dean')
> 1,326
> [numbers entiry fictional]
> But since I have a large number of such names, I would like to just
> join the count per name to the names table like so:
> select name, count(*) from
> names n, texts t
> where contains(text, n.name)
> group by name
> but this returns an 'incorrect syntax near n'.
> Why doesn't the above work? Is what I am trying to do possible using
> the contains function? Is there another way to achieve this goal?
> Thanks!
> Wouter
>

Sunday, February 19, 2012

column heading centered when sort enabled

SQL Server 2005
I have a report with 20+ columns. Normally the text in each colum
heading is aligned at the top of the column heading. The column
heading is three lines high - there is so much text in some of the
columns - it takes three rows to display all of the column heading
text.
Without any sorting enabled - the column heading text is aligned to
the top of the heading row.
For columns with sorting enabled - it appears that it centers the
text. So column headings that are only one row - they are centered in
the heading row - whereas columns that are not sorted align at the
top.
The vertical align property for the row containing column headings is
set to top
It looks bad and I know my customer will object and might rather
disable sorting.
Any ideas?
Thanks!I believe I know what you are talking about. What is happening is that when
sorting is enabled it has to add the sorting "arrow" icon to the headers
and therefore moves the text around in the column header. If you want the
header to not change size (if the size of the cell is growing when you do
this) then turn the "CanGrow" property to "False" and see if that helps.
--
Chris Alton, Microsoft Corp.
SQL Server Developer Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
> From: GoogleGroups@.BaldwinNC.com
> Newsgroups: microsoft.public.sqlserver.reportingsvcs
> Subject: column heading centered when sort enabled
> Date: Tue, 02 Oct 2007 07:03:15 -0700
> SQL Server 2005
> I have a report with 20+ columns. Normally the text in each colum
> heading is aligned at the top of the column heading. The column
> heading is three lines high - there is so much text in some of the
> columns - it takes three rows to display all of the column heading
> text.
> Without any sorting enabled - the column heading text is aligned to
> the top of the heading row.
> For columns with sorting enabled - it appears that it centers the
> text. So column headings that are only one row - they are centered in
> the heading row - whereas columns that are not sorted align at the
> top.
> The vertical align property for the row containing column headings is
> set to top
> It looks bad and I know my customer will object and might rather
> disable sorting.
> Any ideas?
> Thanks!
>|||Thanks for the idea. I only had to change the very first column,
TextBox properties, Format Tab, - I unchecked the "Can increase to
accomodate contents".
Note I only modified the first column heading textbox properties - and
all column headings now appear to be aligned (correctly) to the top.
Thanks!|||I take my last post back. When I "previewed" the report changing just
the first column seemed to fix all columns. But when I deploy the
report - I had to change each column.|||Great. Glad we got it working for you at least :)
--
Chris Alton, Microsoft Corp.
SQL Server Developer Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
> From: GoogleGroups@.BaldwinNC.com
> Newsgroups: microsoft.public.sqlserver.reportingsvcs
> Subject: Re: column heading centered when sort enabled
> Date: Tue, 02 Oct 2007 10:37:17 -0700
> I take my last post back. When I "previewed" the report changing just
> the first column seemed to fix all columns. But when I deploy the
> report - I had to change each column.
>

Column Group Row Alignment - Matrix

I just can not understand why when I add text to a group header the report displays more group row space but when I export to excel the extra space disappears....

What the....Help Microsoft please explain...

Thank You...

Any help on this would be great...

Please

Thursday, February 16, 2012

column description in tables design

Using SS2000. When we design a new table in EM, we often put text in the
description field for each column. We tried copying the table as an object
via DTS to a new server/database and everything seems to transfer except the
descriptions.
Is there a way to transfer the descriptions? Where are they stored? I can
run this query to see what the descriptions are but I can't look inside the
function to see where it's pulling the info from.
SELECT objname, value
FROM ::fn_listExtendedProperty(NULL, 'user', 'dbo', 'table',
'tblleads_branch', 'column', null)
Thanks,
Dan D.
I have not tested it but the DTS Import/Export Wizard, when you select Copy
objects and data between SQL Server databases, has the choice to include
extended properties, unchecked by default. Just check that box and that
should work.
Ben Nevarez, MCDBA, OCP
Database Administrator
"Dan D." wrote:

> Using SS2000. When we design a new table in EM, we often put text in the
> description field for each column. We tried copying the table as an object
> via DTS to a new server/database and everything seems to transfer except the
> descriptions.
> Is there a way to transfer the descriptions? Where are they stored? I can
> run this query to see what the descriptions are but I can't look inside the
> function to see where it's pulling the info from.
> SELECT objname, value
> FROM ::fn_listExtendedProperty(NULL, 'user', 'dbo', 'table',
> 'tblleads_branch', 'column', null)
> Thanks,
>
> --
> Dan D.
|||It did. Thanks.
Dan D.
"Ben Nevarez" wrote:
[vbcol=seagreen]
> I have not tested it but the DTS Import/Export Wizard, when you select Copy
> objects and data between SQL Server databases, has the choice to include
> extended properties, unchecked by default. Just check that box and that
> should work.
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "Dan D." wrote: