Viewing 15 posts - 14,266 through 14,280 (of 26,486 total)
You need to read about sp_executesql in Books Online. This will show you how to return a value from a dynamic query.
October 13, 2011 at 1:20 pm
What if someone updates the table from outside the application? Now you have the possibility of nulls getting inserted.
If the column can never have a null value, specify NOT...
October 13, 2011 at 1:16 pm
First, you really should start writing your queries using ANSI-92 style joins instead of ANSI-89 style joins. It makes your code easier to read and separates the join criteria...
October 13, 2011 at 1:09 pm
daveriya (10/13/2011)
i am getting this error : [Microsoft][SQL Native Client][SQL Server]Conversion failed when converting datetime from character string.i place 'set @Account_date = convert(datetime,'yyyy-mm-ddThh:mm:ss.mmm',126)'
What date are you trying to put...
October 13, 2011 at 10:54 am
drew.allen (10/5/2011)
October 13, 2011 at 10:06 am
Andrew Clark-151434 (10/13/2011)
DB59 is a remote server but on the same LAN, we have no control over the field names (or I would have removed...
October 13, 2011 at 9:56 am
daveriya (10/13/2011)
that i know,i want the exact format
Look up CONVERT in BOL. It will tell you exactly what you need to know.
Here is the link: http://msdn.microsoft.com/en-us/library/ms187928.aspx
October 13, 2011 at 9:53 am
How about something like this:
create procedure testsorting
( @sort varchar(60)
)
as
BEGIN
IF @sort = 'starttime'
BEGIN
SELECT
...
October 13, 2011 at 7:39 am
vick12 (10/13/2011)
Thanks for your replies. Actually I am using SSRS to develop a report and I need to sort the data based on a sort input parameter the user...
October 13, 2011 at 7:08 am
Assuming that a vendor exists in only one location, what do you think this code will return?
Look at the following to help you:
SELECT
VendorState, -- These values...
October 13, 2011 at 7:01 am
vick12 (10/12/2011)
SELECT starttime, convert(varchar(20), starttime,102)+convert(varchar(20), starttime,108) FROM testdate ORDER BY convert(varchar(20), starttime,102)+convert(varchar(20), starttime,108)
I don't see a distinct in the original query.
Sorting on starttime will give the same results as sorting...
October 13, 2011 at 6:24 am
Let me add this, what you need to do is the same thing we do when trying to debug code others have written. The skills we are trying to...
October 12, 2011 at 10:23 pm
You have given us guesses, but you haven't tried to support your answers by analyzing the code. Put together some sample data, 5 or 6 rows and step through...
October 12, 2011 at 10:22 pm
Homework? Test?
No one here is going to give you the ansers. How about you tell us which answer you think is correct and why you think it is correct....
October 12, 2011 at 10:05 pm
Viewing 15 posts - 14,266 through 14,280 (of 26,486 total)