|
Look in the online-help for the datediff function.
|
|
|
|
|
Are you looking for this[^] ?
Happy Programming
|
|
|
|
|
DATEDIFF() function accepts two DATETIME values and a date portion (minute, hour, day, month, and so on) as parameters. DATEDIFF() determines the difference between the two date values passed, expressed in the date portion specified
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|
|
hi
then what should be the data type of that column, so that i can save time only.
bec
in my requirement i have requested any department for a request. so at what time they received my request and what time they have replayed me i.e i want to calculate how much time taken to complete my request
thanks
alisha
|
|
|
|
|
The datatype of the column should be DATETIME...
Use the following type query::
select convert(varchar(10), c6, 108) from t1
In this query, Column 'c6' is of DATETIME type and this query will give you only time part of the column and over this you can use DATEDIFF() function...
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|
|
Hi all,
I have a report created using data in a sqltable.
table contains locations as following
Location
--------
STAPLE STREET
LAKE AVENUE
Hospital Road
Main Street
I dont wanna change them inside the table but i whish if i can chage them as following when in the select command
Location
--------
Staple Street
Lake Avenue
Hospital Road
Main Street
PLease tell me how to do this
Regards
Ruwandi
rkherath
|
|
|
|
|
Do u want that field values should be displayed in Title Case rather than entirely lowercase / UPPERCASE??
Please clarify!!
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|
|
I have a central db as publisher on SQL Server 2005, which has SUPERVISOR user having sysadmin rights.
And created another client db with subscriber user (not having sysadmin rights on the publisher SQL Server 2005), say U1, on SQL Express 2005 instance. As subscriber is the owner of db of subscriber db, so has sysadmin rights on the SQL Express 2005.
Done all the pre-requisite for merge replication.
When I try to replicate between the publisher db & subscriber db with subscriber user, it gives error
"The Publisher failed to allocate a new set of identity ranges for the subscription. This can occur when a publisher or a republishing Subscriber has run out of identity ranges to allocate to its own subscriber or when an identity column data type does not support an additional identity range allocation. If a republishing subscriber has run out of identity ranges, synchronize the republishing subscriber to obtain more identity ranges before restarting the synchronization. if a publisher runs out of identity....."
Although, if the subscriber user is created as sysadmin on the publisher i.e. SQL Server 2005 then the synchronization works perfectly and synchronizes the data.
I would like to know why SYSADMIN right is needed to be given to the subscriber user at the publisher i.e. SQL Server 2005 instance???
Regards
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|
|
Have you looked through the permissions and grants?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi Everyone,
How to get the list of table name and tables related to them, in SQL Server Database???
Thanks in advance...........
-Prashant
|
|
|
|
|
select * from sysobjects
select * from syscolumns
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
SYSOBJECTS table contains all objects created in a databse
SELECT * FROM sysobjects WHERE xtype = 'U' AND uid = user_id()
this returns all tables created in the current database by the current user.
Regards
KP
|
|
|
|
|
good answer. more details
http://msdn2.microsoft.com/en-us/library/ms177596.aspx
|
|
|
|
|
Thank you.
The URL is very usefull for me.
Regards
KP
|
|
|
|
|
You should also look at getschema("Tables"). This is an Ado method introduced in 2.0 to eliminate the need to query the system tables.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
I have a ASP.net interfacee to get the user define date time schedule and I store that in the database. I want to use that data to schedule a job to run the store procedure and get the data and send it through a email
|
|
|
|
|
I have a ASP.net interfacee to get the user define date time schedule and I store that in the database. I want to use that data to schedule a store procedure to be run.
or
For job scheduling in SQL SERVER 2005 we can use job scheduling wizard, but i want to know some other way , like can i schedule jobs in SQL through SQL Storeprocedure what i want to do is i want to provide a interface to a user in ASP or some other tool and i will pass all the require parameters to SQL and schedule the job through Store procedure instead of using the wizard, is there a way like this, please suggest
|
|
|
|
|
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
|
|
|
|
|