all groups > sql server programming > may 2007 > threads for friday may 4
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 to store IP address as a type int?
Posted by wolfv at 5/4/2007 11:01:01 PM
I need to store IP addresses in a Server2000 data base.
Both IP address and int are 4 bytes. But int uses one bit for the sign +-.
So how do data bases store IP_addresses?
Thank you.... more >>
How to get the Supervisor information in 1 row
Posted by zwieback89 via SQLMonster.com at 5/4/2007 10:04:02 PM
Hi,
I have a query which goes like this:
SELECT TOP 100 PERCENT ID, FirstName, LastName, Supervisor
FROM EndoscopyUser.dbo.EndoscopyUser eu
ORDER BY LastName
Every Supervisor will also have an entry in the same table with their ID,
FirstName, LastName, Supervisor. I would lik... more >>
Regenerating a table
Posted by John at 5/4/2007 9:03:23 PM
Hi
We have a table in the db that we suspect is corrupt. There are only about
40 or so records in there. What is the way to completely recreate this table
so it is all clean? We also need the data that is already in the table after
rebuild.
Thanks
Regards
... more >>
Trying my post again: View from a table
Posted by Hassan at 5/4/2007 7:01:34 PM
If I have a table say
Create table TableA ( col1 int, col2 varchar(50),col3 varchar(100))
and then create a view say
Create view ViewA
as select col1,col2,col3 from tableA
Can i perform all the operations against ViewA that I could have otherwise
performed against TableA directly ?
If... more >>
How to trap and ignore Lock Timeout error (#1222) in SQL Server 2000
Posted by mscott NO[at]SPAM eskimo.com at 5/4/2007 3:51:15 PM
In SQL Server 2000, how do you trap error# 1222 [Lock request time out
period exceeded.] inside a stored procedure, so it doesn't propagate
up to the client application?
Here is what I am trying to do. After a batch process has completed, I
want to update the processed flag for every record in... more >>
Nested procedures
Posted by MittyKom at 5/4/2007 2:25:01 PM
Hi All
What would be a best way to create nested procedures like below:
created procedure sp11
As
create procedure sp22
AS
select top 10 * from authors
When i run sp11, it has to create sp22 which i will use later.
Thank you in advance.... more >>
Yet another transposition question
Posted by DeveloperX at 5/4/2007 12:23:47 PM
I've just read through all the transpose column to row threads but
none actually answer my question. It's a little more complicated in
that I think I already have the answer I'm just unsure how to answer
it and I may be missing something that would make the existing
solution workable.
We have... more >>
Query experts: Can you assist?
Posted by ewest305 NO[at]SPAM comcast.net at 5/4/2007 11:34:10 AM
I'll be brief:
Two tables with no relationship between them (no foreign/primary
key).
The only relationship is a range relationship.
That is:
Table A:
ID = 1
ID = 4
Table B:
ID = 2
ID = 3
ID = 5
ID = 6
More simply: Table A contains Header records while Table ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Simple way to get local drive space on system through SQL
Posted by Matthew at 5/4/2007 11:23:36 AM
Is there a simple way to get the amount of space left on a windows
local volume? I found this article, but it seems like its overly
complicated for what it does.
http://www.databasejournal.com/features/mssql/article.php/3549936
Thanks
-Matt-
... more >>
Where to place stored procedures used in support
Posted by Nancy Lytle at 5/4/2007 10:45:56 AM
I have what may be a bit of an unusual question. I one of 2 prod. DBAs in a
company that also has several support personnel who often are required to
run some SQL scripts to purge a job, delete a user, etc. and this is across
two different divisions (the code is slightly different in each). ... more >>
QUery Help
Posted by R C at 5/4/2007 10:29:01 AM
Hi,
i have 2 tables.
table A:
ID - primary key
ID2 - primary key
name
address
table B:
ID - primary key
ID2 - primary key
name
address
i want to select from table A where for records that do not exist in table
B.
any help is appreciated.
... more >>
?_Options
Posted by gok at 5/4/2007 10:27:03 AM
I'm trying to get back key value for a newly added record "in one
shot":
sConnectString = "DRIVER=SQL
Server;SERVER=<serverName>;DATABASE=<dbaseName>;Trusted_Connection=yes;UID=Â;PWD=;";
CBindDatabase dbase;
int rs = dbase.OpenEx( sConnectString, CDatabase::useCursorLib |
... more >>
Help with design for data aggregation
Posted by crbd98 NO[at]SPAM yahoo.com at 5/4/2007 9:57:13 AM
Hello All,
I would like your perspective on a (re)design for data aggregation.
This is the general scoop:
- We have many "data providers" grouped in categories.
- Providers in the same category sent data with the same structure.
- Providers can be added/removed dynamically.
- The data prov... more >>
pivot - rows to columns
Posted by nkg at 5/4/2007 9:32:52 AM
I have a table with with weird column names. how can i convert rows to
columns.
TIA
create table t2(id int, [1] int,[2] int)
go
insert into t2(id,[1],[2]) values(1,5,1)
insert into t2(id,[1],[2]) values(2,6,2)
insert into t2(id,[1],[2]) values(3,7,3)
go
expected result:
[1] ... more >>
How to convert integer value to fixed width text with has 0 prefix filled in SQL Query?
Posted by Ben at 5/4/2007 8:08:14 AM
For example
Data the table String I want
1 000001
12 000012
223 000223
3334 003334
Thanks
... more >>
Can I make a function using 'Compute'?
Posted by Chris G. at 5/4/2007 7:35:01 AM
I have this...
SELECT Top 10 [Year], FMO_03, Product_Name, Jan, Feb, Mar, Apr, May, Jun,
Jul, Aug, Sep, Oct, Nov, [Dec], Total , LinePecentOfTotal
FROM [SCM_DB].[dbo].[f_GICS_Product_FMO_02c_by_Mon] ( @MainProd, @FMO_02,
@FMO_03, @Year)
WHERE [Year] = @Year
ORDER BY Total desc
COMPUTE... more >>
Wait for prev proc to finish execution in 2005
Posted by RickSean at 5/4/2007 7:10:01 AM
In the following code; how do I script to make sure that the execution for
MyStoredProc1 is completed before MyStoredProc2 is started and MyStoredProc2
is completed before MyStoredProc3 is started?
while n <= 3
begin
EXEC MyStoredProc1
EXEC MyStoredProc2
EXEC MyStoredProc3
end... more >>
Bug #: 200107 (SQL Server 7.0)
Posted by sea_cat at 5/4/2007 5:22:01 AM
Hi;
I would like the hotfix for the below problem, sent to me to
sea_cat@hotmail.com
FIX: An access violation exception may occur when you run a SELECT statement
that contains complex JOIN operations in SQL Server 7.0
View products that this article applies to.
Article ID : 867763 ... more >>
Line1: Incorrect syntax near 'AddSentOnlineInfo'
Posted by Orgil at 5/4/2007 4:57:36 AM
I use MSSQL2000 and VB.NET 2005.
My stored procedure's create statement is:
-------------------------------------------------------------------------
CREATE PROCEDURE AddSentOnlineInfo
@ID_User int,
@Desc nvarchar(200)=NULL,
@NewID int OUTPUT
AS
DECLARE @Date datetime
SET @Date = GETDATE(... more >>
Cast Function On Sql Server 2005
Posted by Travis at 5/4/2007 3:06:00 AM
Hi ,
I have the serious problem on Cast function on sql server 2005. Below is
the query I run on 2000 and 2005 as well. 2000 take 1 minutes to generate but
2005
never return the result.
Anyone know the root cause ?
SELECT DISTINCT
DT_ID,
AGN_ID,
AGN_CUR_ID,
AGN_SCH_BCYC_... more >>
T-SQL : Using cursor for update with OPENXML
Posted by oliviers at 5/4/2007 1:18:13 AM
Hi,
Here is my challenge:
1. Declaring a cursor for openxml:
DECLARE xml_data CURSOR FOR SELECT * FROM OPENXML (idoc, '/RootNode/
SomeNode',2)
2. During the fetch loop, I'd like to be able to update the current
row wich is thus a xml node.
Is it possible with the WHERE CURRENT OF cu... more >>
Select query in self referencing table
Posted by Simon Rigby at 5/4/2007 1:14:01 AM
Hello all,
I have a relatively simple table which references itself via the old
ID, Parent ID scenario as follows:
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NOT NULL,
[ParentStudyAreaID] [int] NULL
There is a foreign key (ParentStudyAreaID -> ID).
Top level Areas have a NU... more >>
database doesn't exist
Posted by Hrvoje Voda at 5/4/2007 12:00:00 AM
I have a database name on my sql server wich doesn't exist anymore.
How can I delete it?
Hrcko
... more >>
Create cursor from stored proc
Posted by Josh Carver at 5/4/2007 12:00:00 AM
Hi,
Can I create a cursor from the results from a stored procedure other than by
inserting the results of the proc into a temp table and then creating a
cursor from that table? I'm just wondering if there is some syntax I can't
find online or in BOL to populate a cursor directly from proc ... more >>
Table Partitioning vs. RAID Technology
Posted by Leila at 5/4/2007 12:00:00 AM
Hi,
I'm wondered that which strategy (only in terms of performance) is better:
Suppose that you have 5 disks on your SQL Server. 1 goes for the Log File,
but for the other 4 disks, you can choose RAID 0 (Striping) that has great
IO performance, or you can partition your big and critical "Order... more >>
Default Database Bizarreness
Posted by Mike Labosh at 5/4/2007 12:00:00 AM
Came into work this morning, and EM & QA could not connect to the server:
http://support.microsoft.com/kb/307864
(My default database is Northwind)
So I hit osql -E -d Master :
C:\>osql -E -d master
1> sp_defaultdb 'BUILTIN\Administrators', 'master'
2> go
Default database changed.
1> S... more >>
select query
Posted by EmilH at 5/4/2007 12:00:00 AM
Hi.
I have 2 tables. They have relationship. One of them has a column CtageoryID
which contains ID values of Category table. I need a query which will
display CategoryNames instead of CategoryID in that column. Please help me
with it.
Thank you.
Emil.
... more >>
|