all groups > sql server programming > december 2006 > threads for friday december 22
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
What's 'Do While not rs.eof Loop' in Tsql for SPs
Posted by Filips Benoit at 12/22/2006 8:21:51 PM
Dear All,
I want to loop through a recordset in a SP and add some row-values as
column-values in another table.
#CompanyDayCode
Company Date Code
Com1 1/1/2007 CL
Com1 2/1/2007 CL
Com2 3/1/20... more >>
Learning SQL Server (no software at home)
Posted by Jerry at 12/22/2006 7:23:20 PM
I'd like to learn more about SQL Server. I have 2000 on my work laptop
but not on my home computer. My job will be mostly working with SQL
Server and I'd like to learn as much as possible about it but I don't
really have much time at work to do so. Is there a way for me to learn
more about SQL S... more >>
T-SQL SELECT help please.
Posted by Rick at 12/22/2006 5:22:19 PM
I am trying to convert from MS Access (JET) to SQL Server Express 2005 and
am having trouble with the following SELECT:
SELECT CONVERT(char(7), Clients.RegistrationDate, 120) AS RegMonth,
Count(Clients.ClientID) AS CountOfClientID,
Count(Children.ChildID) AS CountOfChildID
FROM Clients
LEFT J... more >>
Cannot View Database Properties (Express 2005)
Posted by Daniel Manes at 12/22/2006 4:13:25 PM
It's always great to run into problems on a Friday afternoon before a
holiday weekend, but here I am.
I'm not sure when this started happening, but if I try to get
properties on any of the databases on my SQL Server Express 2005 server
(using the Management Studio GUI), it fails with the follo... more >>
Transact SQL - Display Table Column Data Types
Posted by John Walker at 12/22/2006 2:05:00 PM
Hi,
Is there a Transact SQL command which will display the columns and column
data types of a specified table? (as opposed to going into Enterprise
Manager look at table properties)
Thanks,
John
... more >>
Between date/time
Posted by KMG at 12/22/2006 1:51:10 PM
Is there a way to determine in sql 2000 if a date & time is between a date &
time range? For instance, one event is 01/02/07 between 2:00 and 3:00 and
the 2nd event is 01/02/07 and starts at 1:30. I want to check that the 2nd
event is not between the first event's date/time. It could be mor... more >>
function help
Posted by WalterWalt at 12/22/2006 1:45:24 PM
Trying to write a function to resolve ip address to host name (if better way
please post it, thanks!)
From books online insert @tblResult exec xp_cmdshell 'nslookup 127.0.0.1'
should work:
a.. INSERT, UPDATE, and DELETE statements modifying table variables local to
the function.
a..... more >>
Line 1: Incorrect syntax near '<'.
Posted by iporter at 12/22/2006 1:01:34 PM
In the following code, the two Response.Write statements output exactly
the same - I can copy and paste both into Query Analyzer, and run them
fine. However, if I comment out line 3, the assignment of "SELECT
T..." to the variable query, the last line produces the error:
Line 1: I... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Identical Queries (T-SQL batch fast, SP slow)
Posted by johnac014us NO[at]SPAM yahoo.com at 12/22/2006 12:46:41 PM
Hello:
I have a T-SQL batch with a fairly simple design.
Create a temporary table 1.
Insert data into temporary table 1.
Create a temporary table 2.
Insert data into temporary table 2, using temporary table 1 joined to
others.
Create an index on temporary table 2.
Create a temporary tabl... more >>
BCP: Unable to open output file
Posted by Mark Boettcher at 12/22/2006 11:33:01 AM
I am encountering a problem where the BCP utility reports it is unable to
create the output file. This output file is specified on a specific folder.
That folder exists and I am able to place files into that folder using
Explorer. The properties on the source text files are all read/write. I a... more >>
Newbie question for Report Server
Posted by letmesleep NO[at]SPAM writeme.com at 12/22/2006 7:51:47 AM
I have a select statement joining several tables. An aggregate report
will be deployed in Reporting Services. On the Layout tab, I have a
table where I want to place the results.
For example, I have the following result set from the table join
statement
Has Paws
bear ... more >>
backup database and log to hard drive help
Posted by trint at 12/22/2006 5:34:00 AM
I tried to backup to my hard drive from our webserver:
BACKUP DATABASE a2101 TO DISK = 'C:\sqlBackup\12-22-06.dat'
and got this message:
Server: Msg 3201, Level 16, State 1, Line 2
Cannot open backup device
'C:\golfcarcatalog.com\sqlBackup\12-22-06.dat'. Device error or device
off-line.
... more >>
Don't know!
Posted by iporter at 12/22/2006 4:34:56 AM
I have a table with ItemID and TagID. I need to select those itemIDs
that relate to TagID's x and y.
so my table might be:
a x
b y
a y
and I need to get only 'a' when I have the data 'x' and 'y'.
How do I do this?
Thanks,
Iain
... more >>
Can't find error in WHERE CASE...
Posted by anteperkovic NO[at]SPAM vip.hr at 12/22/2006 4:16:06 AM
Hi, all
I just can't find the problem in this part of the code!
SQL Server's Query Analyzer gives me this error:
Server: Msg 170, Level 15, State 1, Line 22
Line 24: Incorrect syntax near 'END'.
The code is:
----
declare @dDate smalldatetime
declare @day_of_the_week int
set @dDat... more >>
BUG in SQL Server?
Posted by Mark Moss at 12/22/2006 1:54:45 AM
Ladies / Gentlemen
Can anyone else confirm that this is a bug or did I just miss something in
class.
DECLARE @INT1 INTEGER,
@INT2 INTEGER,
@RESULT NUMERIC(19,5)
SET @INT1 = 24
SET @INT2 = 7
SET @RESULT = @INT1 / @INT2
SELECT @RESULT
The results... more >>
Data Driven Query Problem
Posted by Kurt at 12/22/2006 1:54:05 AM
Hi,
I've got a big problem with SQL Server 2000 DTS and I hope that you
could help me.
I'm making a package (PKG A) calling an another one (PKG B) using =E0
Data Driven Query. When I run PKG B alone it works perfectly and there
is no problem, that's perfect. But when I run it from the PKG A I... more >>
Restricting user from viewing text of stored procedure
Posted by Jami at 12/22/2006 12:12:23 AM
Dear All!
i have create a view and granted only read access to a user. user cannot
access any other object. but user can execute sp_help, sp_helptext etc
stored procedures. how can i prevent the user from viewing any other
object and executing theses stored procedures
regards,
Jami
... more >>
Drop All tables/ Stored Proc in Database
Posted by User at 12/22/2006 12:00:00 AM
Are there any ways to do that?
I do not have permission to delete database and recreate it again.
Please advise.
Thanks
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** AN... more >>
select not in
Posted by Robert Bravery at 12/22/2006 12:00:00 AM
HI all,
I have two tables, one is live data, the other is off line. I'm looking for
a query that will return all rows that are not found in the live data. If
someone can give me an idea as to how this would look, it would be much
appreciated
Thanks
Robert
... more >>
Full Recovery model and transaction log
Posted by fniles at 12/22/2006 12:00:00 AM
When I have a SQL SERVER 2000 database in a Full Recovery model, I notice
the transaction log just keep getting bigger and bigger.
Will doing a Complete backup and backup the transcation log as part of the
maintenance plan truncate the transaction log ?
Thanks.
... more >>
sql query ... urgent
Posted by lara at 12/22/2006 12:00:00 AM
DECLARE @EndDate DATETIME
SET @EndDate = '20061211' --dec 11
DECLARE @tab TABLE(Emp_Id int , start_Date datetime, End_date datetime )
INSERT INTO @tab SELECT 100,NULL,null
INSERT INTO @Tab SELECT 100, '20061210','20061212' -- dec 10 and Dec 12
INSERT INTO @tab SELECT 101,NULL,NULL
... more >>
Update rows based on related table
Posted by bj at 12/22/2006 12:00:00 AM
Im trying to update rows based on a seperate related table.
I get the query to work below ok in access yet it fails in MS SQL 2000.
Anyone know the appropriate SQL syntax to get the query below to work?
UPDATE CostInc
INNER JOIN products
ON CostInc.PriceCode = products.PriceCode
SET Cost... more >>
|