i have two tables .Table 1 contains certain columns with values.Table 2 shud get those data from table1 into its column and display the calculated result. Any idea how do i go abt it,bcuz table2 shud contain a formula so as to calculate.
hello everone i have a table named "Concerned_Department" in which i ve a filed "Deadline"of type DateTime.i ve another table named "Cat_description" in wh i ve a filed "Max_Days"of type int in wh i ve values 1,2 and 3.in "Cat_Description" table i ve "Cat_ID" as Primary key of type int.all i want is if i select a row from "Cat_description" with "Max_Days"=1, i want to add this 1 to current date and and place it in the "deadline" field of "Concerned_Department" table.like if today is 12/02/2008 then i want to place 13/02/2008 in "Deadline" filed of "Concerned_Deprtment"tablewhen a row with "Max_Days"=1 from "Cat_Description" is selected.i am using SQL SERVER 2005 Exprees and C#(in source behind).regardsAhmed Bilal Jan
how is it possible to set a filed in a database to automatically add the current time to the filed at run time, is this possible; this filed has already been identified as 'DateTime' .
My database has chinese characters in. Eventually I need to only get the first 50 bytes of the data field, but somehow, I use len('==data==',50), it would catch 50 chinese characters which make 100 bytes ... can anyone help me? Thank you very much no matter what the result is ;)
I have a table with two primary key fileds. I will be running a process to populate the data into the table.For each process the first field is constant and second field is auto increment one.
My statements are insert into select ** from ** type one.
How do I auto increment second filed per run. Any delivered function available or any suggestion Pl.................
I'm having two datetime field in my table. One is Call date and another one is Calltime because of some calculations. So I want to save calldate like 4/14/2008 and calltime like 9:30 PM.
I have a database called ‘Objects’ which has many field. One of its fields is called ‘Image’ and has a data type image. I want to add pictures to each one of my records offline, is this possible? i.e. by copying the address from my C drive such as C:Documents and SettingsfseyedarabiMy DocumentsMy Pictures
i ve a filed named "Email" of datatype .i ve created this field to insert email address in this field.but when i insert an email address like "bilal@yahoo.com" from a textbox wh is in an ASP.net webpage then in the filed i see this "System.Web.UI.WebControls.TextBox". can u plz tell me how to fix this Regards Ahmed Bilal Jan
i am trying to insert an auot number field in my table which has got about million rows but sql 2005 is giving me na error "cant insert" i need to index my table so that the query runs faster when i perform joins on two of such huge tables.. i tryid inserting the identity key the way it was mentioned in the forum but sql doesnt let me do that??
How can I validate the date that is coming across in a 8 byte character field via an expression? It will either be a valid date or 0. If it is zero I want to make it a null.
I have a database called 'objects' with one of its fields called 'Image' (data type is set to image) and a file in my desk top labelled as 'Pictures' (this is where all my pictures are keep). At run time i want to be able to select and add (upload) my preferred picture to the image filed of different records. Could you please advice me what i should do?
I have to run a dynamic sql that i save in the database as a TEXT data type(due to a large size of the sql.) from a .NET app. Now i have to run this sql from the stored proc that returns the results back to .net app. I am running this dynamic sql with sp_executesql like this.. EXEC sp_executesql @Statement,N'@param1 varchar(3),@param2 varchar(1)',@param1,@param2,GO As i can't declare text,ntext etc variables in T-Sql(stored proc), so i am using this method in pulling the text type field "Statement". DECLARE @Statement varbinary(16)SELECT @Statement = TEXTPTR(Statement)FROM table1 READTEXT table1.statement @Statement 0 16566 So far so good, the issue is how to convert @Statment varbinary to nText to get it passed in sp_executesql. Note:- i can't use Exec to run the dynamic sql becuase i need to pass the params from the .net app and Exec proc doesn't take param from the stored proc from where it is called. I would appreciate if any body respond to this.
Hi everyoneI am trying to create a DELETE Trigger. I have 2 tables. Table1 andTable2. Table 2 has all the same fields and records as Table1 + 1extra column "date_removed"I would like that when a record is deleted from Table 1, the triggerfinds that record in Table2 and updates the date_removed filed withcurrent time stamp.The primary key on both is combination of domain,admin_group and cn.CREATE TRIGGER [tr_updateTable2] ON [dbo].tbl_Table1FOR DELETEASUpdate Table2SET date_removed = getDate()I'm stuck here, how do I manipulate on Table2 only the records thatwere deleted on Table1, so to only update date_removed filed for themin Table2?I guess i need to compare domain, cn and admin_group, but I don't knowhow.Any help would be greatly appreciatedThanks! :-)
I am create a database and want to store some value automatically in some field i.e say i have 3 column 1) salary(int),2)tax(int) and 3rd field total salary(float) . i want to automatically fill total salary field as Column1-Column2 while i daont have any Idea How to do that? please help me? any idea or tutorial..example anything...
hi,my users can make posts in my web application, i mean they fill a form and the information they filled will be saved in sql server 2000 and can be shown in web application,now i want to give each post an Id and save it in the database, how can i do that? does sql server have the abilities or i should do sth in my c# application thanx
i wonder what is the best approach to use !!!i have creditLimit column in Customer Table the default value will be 500 and this limit to allow users to send sms from my website ..... every month they will be allowed to send 500 sms referring to the credit limit column.... now !!if the user sent today some sms and after few days sent another 20 and after one week he sent 150 SMS as a total so that means he has only 350 SMS as credit to use this month!!!so what is the best approach to implement this solution ? shall i have another field in the table called 'CreditUsed' and that will be updated each time the user will send SMS and this value will be compared with the credit limit ORi use the formula for the column to calculate the credit left and do the maths !!!what is the best approach as you think ???thnaks for reading this question !!
hi there. I have asked this question before in a different section of the forum without much reply, and its probably because i was asking the wrong people. I need to calculate a qouta for an election. SqlCommand SqlCmd1 = new SqlCommand("SELECT count(vote)FROM PRTest", SqlCon1); int quota = (count(Vote) + 1) / ((11) + 1); My problem is this: how to i get the count(vote) value from the Sql Statement to the formula.
This does nothing:([rush24] + [rush6] + [addLocationsTotal] + 50) This gives me my total correctly:([rush24] + [rush6] + 50) All column are numeric(9) except the "total" column which is numeric(13). Why is this happening?
I want to use the proprity Formula related to a column propreties : Exempel : table XFRS i want to pupulate the field XF2 (int 4) using the value of another Field XF1 (int 4) Which is an identity field. But When i try to insert into the table XFRS then i had an error "Insert faild because the following set options have incorrect settings" 'ARITHABORT'"