Viewing 15 posts - 61 through 75 (of 119 total)
assuming if all values in your column is numeric in value only, then you can cast that column as an integer data type. See below for example:
SET NOCOUNT ON
DECLARE...
August 28, 2003 at 12:09 pm
I can also think of:
SET NOCOUNT ON
DECLARE @tt TABLE (THE_DATE SMALLDATETIME)
DECLARE @current_date SMALLDATETIME
SET @current_date = CONVERT(SMALLDATETIME, CONVERT(VARCHAR(10), GETDATE(), 101), 101)
INSERT INTO @tt VALUES('1/1/2003');
August 28, 2003 at 12:34 am
hmmm.. good question.
The type which the AVG() aggregate function used to generate summary values in query resultset.
I tried SELECT AVG(THE_DATE) FROM @tt but it returns the following error...
August 28, 2003 at 12:32 am
Thanks!
However, I decide that it is better to put the ISNULL in the code rather than suppress the message. Is it possible to monitor this warning message from SQL Profiler?
Thanks...
August 19, 2003 at 7:24 pm
Dan:
Thanks for the tip. Using dbcc opentran, there was one stray open transaction. It makes sense now!
Billy
August 14, 2003 at 5:37 pm
What kind of a backup are you trying when you are in SIMPLE recovery mode? When you are in SIMPLE recovery mode, you can only do complete or differential...
August 13, 2003 at 5:36 pm
I would check the SQL Server log and the Event Viewer for any suspicious or valuable information that may explain why SQL Server is going down when you backup log...
August 13, 2003 at 5:20 pm
Be careful here. Table vars do not work exactly the same as temp vars. For example, you cannot use exec as source when inserting into table var.
That is,...
August 11, 2003 at 11:53 am
Using...
Select * from information_schema.columns
where table_name = 'my_table'
...should give you the column names of the table you want to query column names for. Then put a WHERE clause in your...
July 8, 2003 at 12:20 pm
There is probably a better way but the following works...
USE TEMPDB
BEGIN TRAN
GO
CREATE TABLE MY_TABLE(
THE_VALUE_A CHAR(1),
THE_VALUE_B CHAR(1),
CONSTRAINT CHK_A_AND_B CHECK(
...
July 7, 2003 at 12:38 pm
Thanks David and Jay.. I am looking for the best way to address the worst case scenario (ie. huge number of records and text chars are greater than 8000).... I...
May 2, 2003 at 11:53 am
SQL Server is looking for the recordvoidsale column before it is added. Instead, try ....
if not exists(SELECT * FROM [HISPos].[dbo].[syscolumns]
where name='RecordVoidSale')
begin
alter table HISPOSControl add RecordVoidSale bit default 0
exec ('update...
May 1, 2003 at 7:44 pm
No sorting allowed?? ok, then, how about loading the table into a temp table with an identity column and sorting it based on newly created identity column.
Try....
use northwind
DECLARE @tempTable TABLE(THE_ID...
April 8, 2003 at 7:53 pm
Hi Jay:
I thought that you were trying to say that this report should NOT be done with relational programming style. However, just rereading your message it appears I am...
April 8, 2003 at 7:45 pm
Viewing 15 posts - 61 through 75 (of 119 total)