Showing posts with label columns. Show all posts
Showing posts with label columns. Show all posts

Monday, March 19, 2012

Cant see added columns in ASPNETDB.mdf

In developing a VWDE project I added 2 columns to the User table in the ASPNETDB.mdf database. I can see the columns in the Data Definition and I can see the values I added when I Show Table Data but I cannot access them with a SQLDataSource control? The SQLDataSource shows all of the columns in that table except the ones I added. Any suggestions? Thanks.Have you saved the changes to the table before you want to see them in the SqlDataSource?|||

Thank you for responding!

I have saved it, gone in and out of the application over several days and every time, when I look at it in the database explorer window, it shows the added columns and the added data but the SqlDataSource only shows the original columns. I deleted the first SqlDataSource and put in a new one and that didn't help. I know you can add tables to ASPNETDB.mdf but is there something that won't let you add columns to the tables used in the Membership tables (like users)?

Can't see a graphical inicator

We have an SRS report that should show a red, green, or yellow circle for one
of the columns. However, only the green and reds are showing up. The ones
that should be yellow are blank. We cannot see anything different in the
coding for yellow as the others. Any ideas?This has been resolved. We had this codded as a value instead of color.
"Renee H" wrote:
> We have an SRS report that should show a red, green, or yellow circle for one
> of the columns. However, only the green and reds are showing up. The ones
> that should be yellow are blank. We cannot see anything different in the
> coding for yellow as the others. Any ideas?

Saturday, February 25, 2012

Can't paste data

I am trying to migrate an Access database to SQL Express.I created the new database in SQL Express, and added the tables and columns.At this point, I have done so without defining any keys, indexes, or relationships.For most of the tables I was able to copy the data from Access and paste same into the SQL Express tables.

However, I am unable to create the last table, which is a link table to manage the many-to-many relationships.

The table has the following columns:

MediumCode (bigint, null)

ArtistCode (bigint, null)

SongCode (bigint, null)

TrackNumber (int, null)

Here is a sample of the data I am trying to paste:

1,180,204,1

2,2,45,1

3,3,80,1

4,4,30,1

5,5,22,1

6,6,108,1

When I perform the paste there is no error message.The data just doesn’t get added to the table.I don’t understand why the other tables worked and this one does not.I am trying to paste 85 rows. Any ideas?

Also I tried to do this as an INSERT query, but SQL Express does not like the following syntax:

INSERT INTO [Music].[dbo].[tblMediumDetails]

([MediumCode]

,[ArtistCode]

,[SongCode]

,[TrackNumber])

VALUES

(1, 180, 204, 1),

(2, 2, 45, 1),

(3, 3, 80, 1),

(4, 4, 30, 1),

(5, 5, 22, 1),

(6, 6, 108, 1)

Do I have to create an INSERT statement for each row? Is there a bulk load function available in SQL Express, or is that not available with the free version?

Thanks,

Robert

Hi,

you either have to create single insert statements or you define a Insert into statement with a following Select statement like:

INSERT INTO SomeTable
(
Columnlist
)
SELECT Columnlist
From Someothertable


HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||

Jens,

Thanks for the quick reply. Now that I know what needs to be done, I can stop spinning my wheels.

Thanks,

Robert

Thursday, February 16, 2012

Cant Keep Primary Key Columns when moving db to SQL 2005 from 2000

there are some primary key columns which are autoincrement in some tables.
for exampl page_id, now we have deleted many pages in old server so there
are many gaps between the page_id
even the it doest start with 1 because during the testing many initial pages
were deleted.

but when we move it to the new server with sql2005 it gives them numbers from 1,2,3 and
so on.

I need to keep existing 2000 keys. How can I acomplish this?

it would have worked if it also updates this number in other tables which
refer to this column
for example page_id is autoincreement in tbl_category_pages ( this table
contains the page information)
and it also appears in tbl_page_content ( this table contains the page's
content)

because it changes this number at one place and not the other place it makes
the database incorrect.

i tried many things ( there is even an option to keep the values of such
columns but doesnt seem to work)

Thanks,

WessTo maintain existing relationships, simply select all tables and copy them to a notepad. From there you just copy and paste them in the query anlyzer.|||If you want tables with relationships and data, take a complete back up of the database. Use that backup file and restore in sql 2005.|||ramasp,

Thanks, I appreciate your help.

I have given this information to the developer I have working on this. He tells me he tried this and that it can not work because the two versions are different.

Please let me know if this should work and the proccess to do so.

Thanks,

Wess

Friday, February 10, 2012

Can't get this select join to work...

I get an error 'Multi-part identifier '#tmp1' could not be bound.
select #tmp1.col1 as mycol,
other columns...
from #tmp1, realtable
left join table2 on table2.id = #tmp1.col1
...
where realtable.id = table2.realtable
If I reverse the order in the from statement everything is ok but my results
don't seem right.
This statement did work in MySql.
Thanks,
JoeNot a clue what you are trying to do, but you have to realize that this is
not really a good idea, even in MySQL. What version of SQL Server. I
execute the following batch:
drop table #tmp1
drop table table2
drop table realtable
go
create table #tmp1
(
col1 int
)
create table realtable
(
id int
)
create table table2
(
realtable int
)
go
select #tmp1.col1 as mycol
from #tmp1,
realtable
left join table2
on table2.id = #tmp1.col1
where realtable.id = table2.realtable
and get:
Server: Msg 107, Level 16, State 3, Line 1
The column prefix '#tmp1' does not match with a table name or alias name
used in the query.
You are cross joining #tmp1 with the results of realtable left joined with
table2, but your join criteria references the table you are cross joining
to. I don't think this even should be allowed. Change the comma to a cross
join and it will compile, though I am not sure you will get the correct
results.
select #tmp1.col1 as mycol
from #tmp1 cross join
realtable
left join table2
on table2.id = #tmp1.col1
where realtable.id = table2.realtable
Can you explain why the other criteria is in the where clause? I would have
expected:
select #tmp1.col1 as mycol,
other columns...
from #tmp1,
inner join realtable
on realtable.id = table2.realtable:
left outer join table2
on table2.id = #tmp1.col1
Though this may not be what you want, and it may be exactly what you are
doing anyhow, base on where you are doing the different joins.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Joe" <J_no_spam@._no_spam_Fishinbrain.com> wrote in message
news:e9CVgK2AFHA.1452@.TK2MSFTNGP11.phx.gbl...
>I get an error 'Multi-part identifier '#tmp1' could not be bound.
> select #tmp1.col1 as mycol,
> other columns...
> from #tmp1, realtable
> left join table2 on table2.id = #tmp1.col1
> ...
> where realtable.id = table2.realtable
> If I reverse the order in the from statement everything is ok but my
> results
> don't seem right.
> This statement did work in MySql.
> Thanks,
> Joe
>