|
Actually Iam not using replication , Iam mainting a seperate table for the records to be synced.
Is there any way to identify the latest record without using time as key.
krishnan.S
|
|
|
|
|
Probably not then.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I take it that the problem is because of the resolution of time in sql server (meaning you can have the same time on multiple rows).
You could use constantly growing surrogate key for each table but not as a key but as a change identification. This would give you unique, growing values for each row so you could easily identify differences between tables based on this column.
Hope this helps,
Mika
The need to optimize rises from a bad design
|
|
|
|
|
why 2 databases? use backups trigger them often.
if it goes down i would wait after everthing ok and put online again, and use backup to restore data.
if a create a 2nd database i would use it just when 1st goes to "vacations"
and use it like temp store until 1st returns
from that create your own strategies
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Could you pls tell me how you are created backup database. where i am using only single database to keep my 10000 record of info. if something goes wrong what to do...
************ S G KORE *******************
|
|
|
|
|
Hi,
I have 2 identical tables in 2 db's . Is there any easier way to compare the tables and give us the result?
Thanks
krishnan.s
|
|
|
|
|
If you want to find identical rows or differenting rows, have a look at EXCEPT and INTERSECT operands
Mika
The need to optimize rises from a bad design
|
|
|
|
|
i created a application that connects to sql server database.
i show data in a datagridview
i show info msg in a label that belongs to a statusstrip(about changes in datagridview, meaning database)
So, datagridview i fill with tables data and label i fill with c# validations ansers about what happened(OK: client added;ERROR: can´t delete product).
it works but,
i rather fill both (datagridview and label) with data from sql procedures.
any suggestions? maybe write a trigger, add a new table? i really don´t imagine a algorithm for that.
(no need to post code)
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
We've been storing credit card expiration dates in varchar format as MMYY.
Well, before we would just create a new record and keep the old credit card number instead of deleting it (because in the same table we hold the address and it was a means of keeping customers previous addresses on file), but since we're switching to a new system we need to get rid of the old expired card numbers so we don't get charged for authorizations on cards that we KNOW are expired.
Lastly, we need this to work on a continual basis so when we upload an updated csv file to our processor, we *must* give them the date in the format of MMYY, any updates to what we're doing now need to factor that in... so when we pull that file, we're exporting directly from Enterprise Manager into a text file(csv) ready to import into their system.
So, my question is... how can we...
A. Leave the dates in varchar format and find out what cards expired and delete those records?
OR
B. Convert the varchar dates into datetime dates and delete the old card records without converting to a full date?
P.S. I'd like to add that some dates in these text fields aren't 4 digits. For example: 09/10 is in the database as 910.
* * * * Structure * * * *
==CardNum=|=CardExp==|====BillingAddress====
====int===|varchar(8)|====varchar (40)====
4444****** | 06/09 |123 Bobbaganoosh Lane
Any help would be appreciated!
"The whole world steps aside, for the man who knows where he is going. -bd"
|
|
|
|
|
Well, one way would be
declare @now4 varchar(4), @now3 varchar(4)
select @now3 = convert(varchar,datepart(month,dateadd(month,-1,getdate()))) + right(convert(varchar,datepart(year,getdate())),2)
select @now4 = right('0' + @now3,4)
you can now compare to @now3 (such as 808) or @now4 such as (0808)
Hopefully this gives you a starting point.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
that 910 thing is bad
use datediff(),dateadd(),getdate() functions will help a lot.
i builted a movie rental application, some rents were up to 3 days, i had a report procedure when triggered counts day between rent day and delivery day or current day.
As you can guess i got a varchar that could be for exmple:
-1) meening i expect movie to be delivered tomorrow
0) meening i expect movie to be delivered today
+3) meening movie 3 days delay
in store) if movie is back to base.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hello,
I have made a database in SQL 7 and copyied the Date.mdf and log.ldf files from the SQL\Data Directory and copied them to another system but I cannot oipen the database .
How should I open and copy Databases?
Are there any version problems?
Priya
|
|
|
|
|
The best way to do this is to perform a full backup on one database, then restore it to the other computer. Backup and restore will guarantee that the data is consistent. Opening and copying database files from the operating system could potentially cause data corruption by locking the datafile outside the scope of the database engine.
|
|
|
|
|
If one of the servers is SQL 2005 you can use Copy DataBase Wizard
|
|
|
|
|
Hello,
I was able to take the backup but restoring was giving problem. I got the backup on SQL 7 and restoring it on ver 8 .
What must be the problem?
Regards,
Pritha
|
|
|
|
|
You cannot directly copy database files (not actual files or backups) between different versions since they are not compatible.
If you want to move to a newer version, you can:
- take a backup from version 7
- use version 7 instance and restore the backup
- upgrade the instance to version 8
- take a backup from version 8
- restore the backup to desired instance of version 8 if the upgrade was done using *temporary* instance
or you can use DTS and model a transfer between servers (use DTS at the site where version is higher)
Hope this helps,
Mika
The need to optimize rises from a bad design
|
|
|
|
|
Thanks
so this was version problem
Pritha
|
|
|
|
|
I believe so. You're welcome
Mika
The need to optimize rises from a bad design
|
|
|
|
|
|
I'm a newbie so go easy,
Here is the setup:
sharepoint services 3.0
sql 2005 server
Cognos marketing software for dashboards
I just started at this job and the marketing department would like to gather data from sharepoint. They have setup a survey using the survey template in sharepoint services 3.0(I wish they would of used infopath and a dedicated database but oh well). Because we don't have sharepoint 2007 portal and only services 3.0 they are using a product called Cognos. It creates charts and dashboards. They can collect from pretty much any type of database out there. My Question is If someone uses the default survey template inside sharepoint services, where in the world is that data being placed? I've tried to manually search and can not find any data. I have also searched for the last week or so on the net and all I can find is articles about sharepoint 2007 portal. It must be hidden in there some place. Can anyone help?
|
|
|
|
|
humm no reply yet.. and this is a SQL database question by the way....
|
|
|
|
|
Hello,
I am using an Accordion to house textboxes on my page. The problem I am having when inserting it is saying it cannot find the control txtDescription. When writing code in the code behind I can type txtDescription so I can see it from there. For some reason it cannot find that textbox. Possibly many more since it stops at the first one and throws that error. Everything is in an Accordion besides the SQLDATASOURCE
HEre is the SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:GrantConnectionString %>"
InsertCommand="INSERT INTO [Grant_Table] ([Jurisdiction], [Input_Date], [Description], [FY], [Invoice_Number], [Inventory_Number], [Category], [Equipment_Location_Address], [Equipment_Location_City], [Equipment_Location_State], [Equipment_Location_ZIP], [Cost_PPI], [Cost_TAX], [Cost_Shipping], [Cost_TOTAL], [Received], [Equipment_Status], [AWIN_Serial], [AWIN_Operator], [AWIN_Call_Sign], [Contact_Name], [Contact_Phone], [Contact_Address], [Contact_City], [Contact_State], [Contact_ZIP], [Notes]) VALUES (@Jurisdiction, @Input_Date, @Description, @FY, @Invoice_Number, @Inventory_Number, @Category, @Equipment_Location_Address, @Equipment_Location_City, @Equipment_Location_State, @Equipment_Location_ZIP, @Cost_PPI, @Cost_TAX, @Cost_Shipping, @Cost_TOTAL, @Received, @Equipment_Status, @AWIN_Serial, @AWIN_Operator, @AWIN_Call_Sign, @Contact_Name, @Contact_Phone, @Contact_Address, @Contact_City, @Contact_State, @Contact_ZIP, @Notes)"
SelectCommand="SELECT [ID], [Jurisdiction], [Input_Date], [Description], [FY], [Invoice_Number], [Inventory_Number], [Category], [Equipment_Location_Address], [Equipment_Location_City], [Equipment_Location_State], [Equipment_Location_ZIP], [Cost_PPI], [Cost_TAX], [Cost_Shipping], [Cost_TOTAL], [Received], [Equipment_Status], [AWIN_Serial], [AWIN_Operator], [AWIN_Call_Sign], [Contact_Name], [Contact_Phone], [Contact_Address], [Contact_City], [Contact_State], [Contact_ZIP], [Notes] FROM [Grant_Table]">
<InsertParameters>
<asp:QueryStringParameter Name="Jurisdiction" QueryStringField="UserLocation"
Type="String" />
<asp:ControlParameter ControlID="txtInput_Date" Name="Input_Date"
Type="DateTime" />
<asp:ControlParameter ControlID="txtDescription" Name="Description"
PropertyName="Text" Type="String" />
<asp:QueryStringParameter Name="FY" QueryStringField="FY" Type="String" />
<asp:ControlParameter ControlID="txtInvoiceNumber" Name="Invoice_Number"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtInventoryNumber" Name="Inventory_Number"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtCategory" Name="Category"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtAddress" Name="Equipment_Location_Address"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtCity" Name="Equipment_Location_City"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtState" Name="Equipment_Location_State"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtZipCode" Name="Equipment_Location_ZIP"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtCostPPI" Name="Cost_PPI"
PropertyName="Text" Type="Decimal" />
<asp:ControlParameter ControlID="txtTax" Name="Cost_TAX" PropertyName="Text"
Type="Decimal" />
<asp:ControlParameter ControlID="txtShipping" Name="Cost_Shipping"
PropertyName="Text" Type="Decimal" />
<asp:ControlParameter ControlID="costLiteral" Name="Cost_TOTAL"
PropertyName="Text" Type="Decimal" />
<asp:ControlParameter ControlID="txtReceived" Name="Received"
PropertyName="Text" Type="DateTime" />
<asp:ControlParameter ControlID="txtEquipmentStatus" Name="Equipment_Status"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtAWINSerial" Name="AWIN_Serial"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtAWINOperator" Name="AWIN_Operator"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtAWINCallSign" Name="AWIN_Call_Sign"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtContactName" Name="Contact_Name"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtContactPhone" Name="Contact_Phone"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtContactAddress" Name="Contact_Address"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtCity" Name="Contact_City"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtContactState" Name="Contact_State"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtContactZip" Name="Contact_ZIP"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtNotes" Name="Notes" PropertyName="Text"
Type="String" />
</InsertParameters>
</asp:SqlDataSource>
Here is the error:
Source:
System.Web
Data:
System.Collections.ListDictionaryInternal
Inner Exception:
Location:
add.aspx
Message:
Could not find control 'txtDescription' in ControlParameter 'Description'.
|
|
|
|
|
I HAVE A COLUMN WHICH NAME IS "ID.ID2"
I WANT TO RENAME BY USE FOLLOWING QUERY:
SP_RENAME 'T1.ID2','ID'
BUT I GOT AN ERROR:
No item by the name of 'T1.ID2' could be found in the current database 'Zaid', given that @itemtype was input as '(null)'.
I ALSO TRY TO THIS COLUMN THROUGH THIS QUERY
ALTER TABLE T1
DROP COLUMN T1.ID2
BUT IT ALSO GIVES AN ERROR
Incorrect syntax near '.'.
please solve it
|
|
|
|
|
Its a typo
try
SP_RENAME 'T1.[ID.ID2]','ID'
(or whatever your column is called, it should be
SP_RENAME '{tablename}.{columnname}','{newcolumnname}'
Bob
Ashfield Consultants Ltd
|
|
|
|
|
thank u very much.
My problem have been solved
|
|
|
|
|