|
I want to make a job in SQL calculate the unfixed occasion every year like easter it is in the first monday on May, I want to get the date day/month/year.
merwa
|
|
|
|
|
I want to make a check constrain in 7 Colum together each Colum take a bit I want to make only one Colum true and the other is false in each row. How can I do that.
merwa
|
|
|
|
|
i assuming that you want your result should be somehting like this
column1 column2 column3 column4 column5 column6 column7
false false false true false false false
only one column can have true value, right?
|
|
|
|
|
|
so whats your question? you want to give some constraint that only one true value can be entered database level or form level?
clarify your scenario please
|
|
|
|
|
how one can apply unique constraint using MS SQL Server Management Studio.
I can see in table property "Replicated" but i can't change its values as its disabled. Or I've to user general query like the one below;
CREATE TABLE Customer(SID integer UNIQUE);
|
|
|
|
|
Does anyone know a fast way of getting the primary key column of a table using SQL SMO? My aproach so far has been to run through all of the columns checking to see if they are primary key columns...
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
|
tbl.Indexes(0).Name seems to give me the constraint name...but i need to column name, sorry if i missed it, but i didnt see it in your code.
Thanks for the quick response
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
As far as I can remember you'd have to loop and check.
Is the problem that doign the loop and check is very slow?
If so check out the 'SetDefaultInitFields' method.
|
|
|
|
|
The fastest way i have found so far is by extending your idea slightly:
<br />
If tbl.Indexes.Count > 0 Then<br />
If tbl.Indexes(0).IndexedColumns.Count > 0 Then<br />
Return tbl.Indexes(0).IndexedColumns(0).Name<br />
End If<br />
End If<br />
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Hi,
its possible to generate some event from database? Let say that i have in some table cell with date and time with value 23-06-2007 13:14:05 and when time will be equal to this value database will do some thing like: remove this record and increment some value in other table...
Its possible to do?
Any idea how resolve it?
Greetings
|
|
|
|
|
I think your looking to implement Trigers[^]
|
|
|
|
|
Hi,
no... im not looking for trigers... trigers are launched when someone do insert update etc... not when some valu eis equal to other value...
Greetings
|
|
|
|
|
How does one value becomes equal to another without some update operation?Anyways you seem to know what you want...
|
|
|
|
|
It should works like:
Table structure
id - int
time - datetime
action - varchar
Current operation time: 30-06-2007 11:40:01
insert new row with value
time="30-06-2007 13:33:11"
action="delete"
nothing happen cause now is 30-06-2007 11:40:01
time spend... and is 30-06-2007 13:33:11
Sql server do some action like deleting row and insert or increment data in another one table...
Sorry for my english
Greetings
|
|
|
|
|
I found that in MySQL is something like: create event
Is in MsSQL2005 something simmilar?
Greetings
|
|
|
|
|
You're talking about a trigger, all right.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can you give me a sample how to do this using trigers?
Gretings
|
|
|
|
|
The SQL Server books online have lots of trigger examples, a trigger is code that runs when a table is updated or inserted, in that code, you can examine the values that were changed or added, and modify your actions according to those values.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
I would seem that what you actually want to do is use the database to control a schedule: by setting the start date and time in some field in a table you want to be notified when that entry equals the current system time.
I don't know of any way to do this purely in the database without any external program help. You would need to poll the database and do the comparison yourself programmatically...
|
|
|
|
|
i want to create a trigger.in that trigger when modifying a value from a categorytable i want to check whether any another table in the database containing category id with that value .if it is there i want to display one message.How can i do that?.............
|
|
|
|
|
You can query sysobjects for tables in your database and syscolumns for their respective columns (based on ID).Run these queries on your database
<br />
select * from sysobjects<br />
select * from syscolumns<br />
|
|
|
|
|
YESTERDAY I POSTED SOME QUERIES I NEED THEM NOW BUT THEY HAVE BEEN MOVED
WOTS THE REASON?
I NEEDED ALTERNATIVES FOR THOSE QUERIES
|
|
|
|