Monday, March 12, 2012
Integers, Money values becoming zeros
When I reset the SQL query in Database ->Show Sql Query, all integer and money type values are becoming zeros. When I execute the same query in the SQL Query Analyzer I am getting the values with same no. of records in the report. Can anybody suggest me the solution.
The only difference before resetting, the query doesn't have "WHERE" clause.
Thanks in advance.Post the query you used and the table structure
Integers in SQL Server
- DTS pull data from Excel into temp tables Stored proc pulls from the first temp table into a supertype table IDENTITY column assigns primary keys Stored proc then loads primary keys into a cursor and, starting with the LAST record, moves the PK into the appropriate subtype table and assigns the correct foreign key enteries. Next stored proc pulls data from the second temp table into the supertype tabel Repeat process until all data is stored
I think I figured out a solution that doesn't use cursors and won't be affected by internal storage issues. However, comments and ideas are still welcome.|||Having staging table(s) is a very good thing when it comes to data import/export. If you can, try to eliminate dts from the process to save some cpu cycles. You'd want to look up linked server/openquery/openrowset/opendatasource in book online/google for some details.
Integers & dynamic allocation
I want to goup "members" togethers in a "group."
A table for members and a table for groups.
each containing coluns...
but inside Groups I would like a column that contains ID numbers for the members that be long to that group.
Being that members can belong to multiple groups - I can not use a GroupID in Members - if so I also need a way of it modular.
Obvisiously I am not a very good DB programmer - but I want the least amount of empty/unused space in my tables.
Hope this makes senseyou need a third table (tblMemberGroups) that contains two columns
MemberID and GroupID
this table allow any member to belong to any number of groups and give you a normalized database structure (no wasted space).
you would need to create joins between all 3 tables to determine group membership
members -> tblMemberGroups -> groups