all groups > sql server programming > december 2005 > threads for saturday december 17
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
how can I put this into one query
Posted by Al Newbie at 12/17/2005 11:14:16 PM
I have a table (tblJobs) that has a delivery date - to this date I want to
add a set amount of 'working' days
I have a table of dates with columns that specify whether the date is a
weekday and a holiday.
for each record in the tblJobs table I want the calculated date to appear in
the reco... more >>
Ordered Insert misleading syntax
Posted by Martin at 12/17/2005 10:22:39 PM
Hi,
I've recently read that I can't do ordered inserts, which is a shame.
However the following syntax appears to be valid
DECLARE @TimeLine TABLE(EventID int IDENTITY(1,1),EventType int,EventKey
varchar(50),[Date] varchar(50))
INSERT INTO @TimeLine (EventType,EventKey,[Date])
select 1... more >>
about CTE in SQL 2k5
Posted by congling at 12/17/2005 9:21:32 PM
Hi all,
I tested a new feature of SQL2005 (named cte for recursive selection)
and found the order of the result was weird.
According to the description of help:
1. Split the CTE expression into anchor and recursive members.
2. Run the anchor member(s) creating the first... more >>
need some TSQL help
Posted by Hassan at 12/17/2005 9:19:21 PM
I have some entries in a column as such
XYZ ( ABC ) ( 1)
XYZ ( ABC ) ( 11)
XYZ ( ABC ) ( 2)
XYZ ( ABC ) ( 3)
XYZ ( ABC ) ( 4)
UVW ( XYZ ) ( 10)
UVW ( XYZ ) ( 12)
UVW ( XYZ ) ( 41)
So i want to group entries like this by the first ')' seen
so I can get distinct values such as
XYZ (... more >>
login event in sql server ??
Posted by helmut woess at 12/17/2005 7:03:56 PM
Hi,
is there a way in SQL 2000 to check a new login and to stop it?
I want to be informed if a user makes a new connect, then i want to check
the program name he uses for connect and if this is not a valid name i want
to cancel his login.
I think it should be possible with a trigger on the ta... more >>
Getting the corresponding primary key from MAX()??
Posted by Greg at 12/17/2005 6:35:55 PM
I think this should be easy, but maybe my brain is just not working today,
can anyone offer suggestions?
I have a table, Table1 (simplified):
ID dollars
1 15
2 30
4 22
Using T-SQL, how can I get the ID value for the record with the highest
num... more >>
what is wrong with this UDF?
Posted by Al Newbie at 12/17/2005 6:03:55 PM
I have this UDF but it comes back with the message:
The column prefix c does not match with a table name . ..
what is it that I have done wrong - the query works fine by itself . . . .
CREATE FUNCTION dbo.AddWorkDays
(
@dte smalldatetime,
@NoDays tinyint
)
RETURNS smalldatetime
AS
BE... more >>
Decimal or Float Type in Percent
Posted by Scott at 12/17/2005 3:42:35 PM
Below is a sniplet of a select expression that returns a decimal number like
..6153329998
The result is correct, but when I say FormatPercent(objRS("myPercent"),3) in
ASP, I get a type mismatch error.
Both myField1 and myField2 are integer type. I have to CONVERT myField1 into
decimal in... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Access to another database via a stored procedure
Posted by et at 12/17/2005 2:26:42 PM
I have a stored procedure on a database that selects information from
another database, and the users running the stored procedure are not users
on the 2nd database. I don't want to have to enter all users individually
into the 2nd database, I just want anyone who has execute rights to that
... more >>
SQL types
Posted by GTN170777 at 12/17/2005 1:54:01 PM
Hi can anyone explain the diferences between the various SQL Server licences
i.e -
Express/Workgroup/Standard/Enterprise
I'm building an ASP application and have gone for SQL instead of Access due
to the number of concurrenr queries it allows. The application sits on a
dedicated server (inte... more >>
Create temp table
Posted by simon at 12/17/2005 12:35:04 PM
IF I create temp table and insert something into it:
create table #temp(col1 int,col2 int,col3 int,col4 decimal(15,5),col5
decimal(15,5),col6 decimal(15,5))
INSERT INTO #temp(col1,col2,col3,col4,col5,col6)
SELECT col1,col2,col3,col4,col5,col6 from table....
drop table #temp
it takes 2... more >>
Problems Concatenating Columns
Posted by Simon Harris at 12/17/2005 11:28:07 AM
Hi All,
I am getting some rather strange results when concatenating columns.
Please see my inline comments below...
SELECT
'http://www.oursite.co.uk/scripts/prodview.asp?idproduct=' +
CAST(products.idProduct AS Char(4)) AS product_url,
('Replacement '
+
Case When CharIndex(';',Products... more >>
GETDATE() to insert into a datetime field
Posted by GTN170777 at 12/17/2005 11:22:03 AM
Hi there, may seem like a really silly question, but i am new to SQL.
I'm building as ASP application in Dreamweaver MX2004 i'm using the insert
record behaviour to upload information to the SQL Server. one of the fields
is DateRegisterred which in Dreamweaver is a hiddenfield with the value se... more >>
My Cursor Operation - Efficient?
Posted by Simon Harris at 12/17/2005 9:51:22 AM
Hi All,
I am trying to write a query that will conditionally carry out some string
manipulation on as the records are retrieved. This much I am fine with,
what
I'm not sure about is the most efficient way to use a cursor.
Below is what I have written so far (psudo code for ease of reading) ... more >>
SQLDMO:To Change Database file Location path of DBBackup file ( VC
Posted by Inthi at 12/17/2005 3:45:02 AM
Dear all
I am creating a tool in VC7.0 for database restoration
I am facing a problem while working with sql dmo objects i need to restore
a database, which has database location as "C:\Program Files\Microsoft SQL
Server\MSSQL\Data\Sample.mdf" to new instance of SQlserver called as
NEWIN... more >>
|