Viewing 15 posts - 1 through 15 (of 17 total)
Declare @time datetime
Set @time = (select cast((select(left((getdate ()- 10),11))+' '+ '00:00:00.000') as smalldatetime))
Delete from YourTable where DateColumn <= @time
November 19, 2007 at 9:17 am
Of course!
You have to put the 'group by' clause after the where condition.
Here's one example:
Select t, count(*) from yourtable
where t in ('A', 'B')
group by t
November 16, 2007 at 5:32 am
You ca also add: BACKUP LOG [Yourdatabase] WITH NO_LOG
Finally, you have:
BACKUP LOG [Yourdatabase] WITH NO_LOG
ALTER DATABASE [Yourdatabase] SET RECOVERY SIMPLE
DBCC SHRINKDATABASE ( [Yourdatabase], TRUNCATEONLY )
November 14, 2007 at 6:16 am
What kind of data type is income? And expense?
If they are decimal data type, your query works.
November 14, 2007 at 3:36 am
I mean a data type compressed with the sign (+/-)
In particular, I have a table (T1) in which there is a column (t) defined as text.
The output of this query
select...
November 13, 2007 at 9:16 am
Hi!
You can't assing to @var two values (col and col2).
Try this:
DECLARE @col (-- insert data type)
DECLARE @col2 (--insert data type)
DECLARE scanprofile CURSOR READ_ONLY
FOR
select col,col2 from sometable
OPEN scanprofile...
September 20, 2007 at 1:52 am
Hi!
You can use this stored procedure
sp_helpindex [tablename]
which gives you the index name,the index description and the index keys.
September 19, 2007 at 6:13 am
Sorry, I posted before ending...
For char and varchar, n must be a value from 1 through 8000.
Does the Varchar2 exist for SQL? I know it's used by Oracle...
September 19, 2007 at 4:38 am
The char data type is a fixed-length ANSI character data type when the NOT NULL clause is specified. If a value shorter than the length of the column is inserted...
September 19, 2007 at 4:22 am
For executing the stored procedure using a cursor, you can use this one:
-- Var Declare
DECLARE @name varchar(100)
DECLARE @Database varchar(100)
DECLARE @query nvarchar(4000)
-- Cursor Declare
DECLARE DB CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
where name <> 'tempdb'
and...
September 13, 2007 at 4:56 am
I think you may also add an id column in your table using the identity function.
September 4, 2007 at 4:52 am
I don't know how many records are flagged as active...
What do you think about creating a view with all the records with isActive = 1 and running the queries on this view?
July 23, 2007 at 8:23 am
Sorry, my brain is very tired today
Which is the column to join? The only possible column is the key_column, isn't it?
In your query, which are...
July 19, 2007 at 4:44 am
Sorry, I can't understand...
Would you possibly specify your needing? Can you give an example of the otuput table?
July 19, 2007 at 4:24 am
Hi!
You can use a cursor like this one:
DECLARE @name varchar(100)
DECLARE @Database varchar(100)
DECLARE @query nvarchar(4000)
DECLARE DB CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
where name not in ('tempdb', 'master', 'model', 'msdb', 'Northwind')
order by name
OPEN DB
FETCH...
July 19, 2007 at 3:34 am
Viewing 15 posts - 1 through 15 (of 17 total)