Showing posts with label bunch. Show all posts
Showing posts with label bunch. Show all posts

Thursday, March 22, 2012

Comparing contents of one row to multiple rows in another table?

Hi,

I've a bunch of records that may contain data that I'm after. For example:

This is a fake title [electronic resource]. 1997.

I have a very small table (~10 rows) of things like '[electronic resource]'

Is there any way to see if my record contains any of the 'target' items in the other table?

Need more information. Can't able to follow you. Can you post more info pls...

Wednesday, March 7, 2012

Compact method to reset Identity columns

I have a demo database in SqlCE that I am getting ready to deploy. I deleted a bunch of test records and now want to reset the identity columns. The compact method runs fine, but the identity columns are not being reset? So when I add a new record, the returned identity value is over 1,000 even though the highest value is only 50.

Any help is greatly appreciated!

Kind Regards,

Mat

Try out: ALTER TABLE <IdentityTable> ALTER COLUMN <Identity Column> <Data Type> (51, 1);

Thanks,

Laxmi

|||

I tried this:

ALTER TABLE asset ALTER COLUMN iid bigint (51,1)

but get the following error message:

The specified data type is not valid. [ Data type (if known) = bigint ]

Bigint is the data type of this field, but I get the same error message if I try int as well. Thanks for your help!

Kind Regards,

Mat

|||

Use

"ALTER TABLE asset ALTER COLUMN iid IDENTITY (51,1)"

|||

Pragya,

This worked perfectly!

Thanks,

Mat

Compact method to reset Identity columns

I have a demo database in SqlCE that I am getting ready to deploy. I deleted a bunch of test records and now want to reset the identity columns. The compact method runs fine, but the identity columns are not being reset? So when I add a new record, the returned identity value is over 1,000 even though the highest value is only 50.

Any help is greatly appreciated!

Kind Regards,

Mat

Try out: ALTER TABLE <IdentityTable> ALTER COLUMN <Identity Column> <Data Type> (51, 1);

Thanks,

Laxmi

|||

I tried this:

ALTER TABLE asset ALTER COLUMN iid bigint (51,1)

but get the following error message:

The specified data type is not valid. [ Data type (if known) = bigint ]

Bigint is the data type of this field, but I get the same error message if I try int as well. Thanks for your help!

Kind Regards,

Mat

|||

Use

"ALTER TABLE asset ALTER COLUMN iid IDENTITY (51,1)"

|||

Pragya,

This worked perfectly!

Thanks,

Mat