Viewing 15 posts - 76 through 90 (of 119 total)
VARCHAR can be sorted (unless there is some other way that defines the sort order of that table). In your case, you will be sorting by NAME alphabetically.
If you...
April 8, 2003 at 2:03 pm
Thanks for your response.
However, wouldn't it be better to build this report using relational programming rather than something else like procedural programing? All we are trying to do is...
April 8, 2003 at 1:51 pm
USE NORTHWIND
SELECT TOP 1 *
FROM (
SELECT TOP N * FROM Employees ORDER BY EmployeeID ASC
) X ORDER BY EMPLOYEEID DESC
where N is the ordinal position of the record you want...
April 8, 2003 at 12:42 pm
Thanks for your response.
However, the number of groups is unknown. Therefore, generating a dynamic query (ie. piecing it together the SQL statement) may not be the best solution for...
April 8, 2003 at 11:36 am
EXEC sp_MSforeachtable "print '?' dbcc checktable ('?')"
March 27, 2003 at 6:14 pm
A comment on CASTing a text value into a date datatype:
It is always better to use CONVERT instead of CAST for explicit conversion, especially in the international environment. Please...
March 26, 2003 at 6:42 pm
inserted and deleted tables are used in conjunction with triggers.
See example below:
/* -- cut here -- */
use tempdb
begin tran
set nocount on
create table table1(id int identity(1,1), value varchar(50));
go
create trigger tr_table1 on...
March 26, 2003 at 6:31 pm
DECLARE @inmhlka VARCHAR(20)
DECLARE @exec_stat VARCHAR(1000)
SET @inmhlka= '1,2,3,4'
SET @exec_stat = 'SELECT dbo.Table1.Field1, dbo.Revenue.Services FROM dbo.Revenue INNER JOIN dbo.Table1 ON dbo.Revenue.Services = dbo.Table1.Field1 WHERE (dbo.Revenue.Services IN (' + @inmhlka + ')) ORDER...
March 26, 2003 at 2:32 pm
When you use SET @inmhlka= '3,4,6,7,8,9,10', it is looking for the value '3,4,6,7,8,9,10' in the service field. That is why it works when you search for '3'.
In this case,you...
March 26, 2003 at 1:05 pm
there are only 3 params...
sp_MSobject_dependencies name = NULL, type = NULL, flags = 0x01fd
name: name or null (all objects of type)
type: type number (see...
March 25, 2003 at 2:46 pm
Thanks. "Select Convert(Char(5),GetDate(),101)" gives me exactly what I asked for.
However, I used the wrong example to illustrate my question. What if I want "MM/YYYY"? Do I have...
March 20, 2003 at 11:53 am
just an aside note, you might want to review what kinds of permission the "generic SQL Server ID" sa should be having. In general, it is a good idea...
March 18, 2003 at 2:33 pm
You can use a check constraint for this...
Hope that helps
Billy
/* -- cut here -- */
begin tran
set nocount on
create table aaa(a int,b int,c int,constraint chk_aaa check((a is not null and b...
March 18, 2003 at 2:24 pm
Try this... hope that helps shed some light...
Billy
/* --- cut here --- */
begin tran
set nocount on
create table aaa(aaa_value int);
insert into aaa(aaa_value) values(1);
insert into aaa(aaa_value) values(2);
insert into aaa(aaa_value) values(3);
create table bbb(bbb_value...
March 18, 2003 at 1:21 pm
Thanks Michael.
The sp_helptext method is not an option because the proc is over 8000 chars long (the entire create proc script will not fit in the varchar(8000) I declare for...
February 26, 2003 at 12:34 pm
Viewing 15 posts - 76 through 90 (of 119 total)