all groups > sql server programming > march 2007 > threads for friday march 23
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
VARBINARY Conversion
Posted by Karch at 3/23/2007 6:43:15 PM
So, what is actually happening here?
DECLARE @datenow as DATETIME;
DECLARE @dateBinary as VARBINARY(MAX);
SELECT @datenow = '3/23/2007 12:00:00AM';
SELECT @dateBinary = CAST( @datenow AS VARBINARY(MAX))
SELECT @dateBinary
@dateBinary = '0x000098FA00000000'
(using a date of '3/2... more >>
Protecting sheet with update vba script
Posted by Clayton Dool at 3/23/2007 4:53:09 PM
I have a workbook with multiple sheets. When trying to protect the
sheets, I can no longer update the data and underlying pivot tables
programmatically. How do I approach this?
Workbook
----------------------------------
- Sheet 1
- Contains Query Table linked to SQL
... more >>
ownership
Posted by Ed at 3/23/2007 4:37:05 PM
Hi,
Is there anyway to change the owner of the objects all at one time? I
have a user called "JB" who left the company but there are some objects that
are owned by him.
He owns over 50 objects
I know I can issue sp_changeobjectowner, but I would like to change them all
at once.
Than... more >>
Calculate percentage of columns.
Posted by aiu4840 at 3/23/2007 3:58:01 PM
Hello,
I have the following two result sets:
1.
BusinessUnitDescription TotalDIRECTRunLaborHours
20410-Food Bar Weighup 598.500000
20420-Food Bar Pilot 2172.000000
20430-Food Bar 463.500000
20480-Food Bar Hand Assembly 97.500000
2.
BusinessUnitDescription TotalRunLaborHours
204... more >>
Calculate percentage of columns.
Posted by aiu4840 at 3/23/2007 3:44:42 PM
Hello,
I have the following result sets:
1.
BusinessUnitDescription TotalDIRECTRunLaborHours
20410-Food Bar Weighup 598.500000
20420-Food Bar Pilot 2172.000000
20430-Food Bar 463.500000
20480-Food Bar Hand Assembly 97.500000
2.
BusinessUnitDescription TotalRunLaborHours
20410-Fo... more >>
"The multi-part identifier "Users.RecID" could not be bound" error on simple update
Posted by Claire at 3/23/2007 3:20:51 PM
"Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "Users.RecID" could not be bound."
I'm in the process of changing my database. Im introducing a SiteID value in
addition to UserID in tables that need it so we can have multi site with a
central server with synchronization.
Ther... more >>
Outer Join and null values as zero(0) query
Posted by kw_uh97 at 3/23/2007 2:07:00 PM
Hello All
Hope you can help with this query
Here are my requirements:
1) get rows greater than 2-1-2007 from #v (that first day of last month from
getdat())
2) include rows where displatindictor =1, also Cast all null values as
zeros(0) on Recordables column.
So my return set should... more >>
Warning in Event Viewer
Posted by Andre Gibson at 3/23/2007 1:21:05 PM
Hi all
I am reviewing my application log in the windows2003 event viewer I am
getting the following warning regarding my sql server2000 installation and my
tape drive. Can anyone assist me in resolving this? I don't think its
anything critical by my log is filled with these warnings. Any he... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
error 443
Posted by JB at 3/23/2007 1:10:48 PM
I am trying to use SET DATEFIRST in a user defined function and get error
443, Invalid use of 'SET COMMAND' within a function
An example ..
CREATE FUNCTION dbo.fnGet( @dtDate smalldatetime )
RETURNS smallint AS
BEGIN
SET DATEFIRST 7 -- raises error 443
....
... more >>
builtin functions help
Posted by rodchar at 3/23/2007 1:02:05 PM
hey all,
when i'm in management studio building a query and i need to use a function
like DATEDIFF is there anyway to get some hint as to what params i need
besides going to Books Online for quick reference?
thanks,
rodchar... more >>
syntax to determine if constraint exists
Posted by John Grandy at 3/23/2007 12:51:33 PM
What's the syntax to determine if a constraint exists ?
( I need to write sql to drop a constraint if exists before creating it. )
... more >>
Hyperlink Column
Posted by MattG at 3/23/2007 11:51:14 AM
Can someone direct me on how to make a column a clickable hyperlink on a
hosted sql server... more >>
userdefineddatatype with datatype comparsion
Posted by Ganesh at 3/23/2007 10:21:05 AM
Hi There,
I've same records in both table, but it doesn't return any records
TP_Relationship.PocID is userdefineddatatype int
TP_Location.POCId is int not userdefineddatatype int
could it be a proble if i compare userdefineddata type with datatype
SELECT TP_Location.POCId, TP_Loca... more >>
Need to provide documentation
Posted by Bahman at 3/23/2007 9:52:05 AM
Hi!
I have been asked to provide documentation for a database that consists of
tables, views, sps, dts, etc.
The only problem is that it is supposed to be legible to someone who is a
'novice'. That poses a technical challenge.
Are there guidelines or sample documents that allow me to be... more >>
Getting the records count from a cursor
Posted by StephenMcC at 3/23/2007 9:26:15 AM
Hi All,
I'm new to cursors and I'm wondering if it's possible to get the record
count/no of rows from a cursor before/without having to loop through the
contents, similar to SELECT @COUNT=COUNT(id) FORM my_table.
Any help/advice much appreciated.
S.... more >>
Reporting services trial software
Posted by David at 3/23/2007 9:20:13 AM
Hi there,
I would like to download the free trial version of reporting services from
Microsoft's website. Can anyone point me to the web link? I am finding myself
unlucky to do so.
Thank you very much... more >>
Concurrent Connections
Posted by CLM at 3/23/2007 9:18:12 AM
I got an interesting email this morning from a manager:
"How many concurrent connections can SQL Server allow? I’m asking because
we are trying to determine our concurrent users threshold. Let me know if
you have any questions. Thanks."
Isn't it true that if you have any reasonable am... more >>
Result Set
Posted by Audrey Ng at 3/23/2007 8:37:01 AM
Hi everyone,
I have a main Company table with let's say:
Company A,B,C,D,E
I have a view with data allocated to Company A,B,C
However, I want my result set to show Company A,B,C,D,E
where D,E will also be displayed but showing 0 values
as opposed to not be displayed at all in the result ... more >>
proc an sql query yield different results
Posted by Herbman at 3/23/2007 8:34:41 AM
Hi,
I have a stored procedure that accepts a parameter used to output the results.
when I execute this stored procedure, I get different result than if I were
to
execute the stored procedures code in sql query analyzer:
In SQL Query Analyzer I run the following:
DECLARE @StatusId in... more >>
Seeking a clever in-query SQL solution to sequences
Posted by kgerritsen at 3/23/2007 8:33:11 AM
Hello,
I have an output from a legacy logistics application that I want to
reconcile with a related table in my SQL Server (update destination
and postage with new values after the logistics app runs). My
granular entity is a tray (or container), which is N:1 to a
manufacturing cell, which i... more >>
Calling stored proc and running procedure sql give different resul
Posted by Herbman at 3/23/2007 8:32:08 AM
Hi,
I have a stored procedure that accepts a parameter used to output the results.
when I execute this stored procedure, I get different result than if I were
to
execute the stored procedures code in sql query analyzer:
In SQL Query Analyzer I run the following:
DECLARE @StatusId in... more >>
The database could not be exclusively locked to perform the operation.
Posted by Lee at 3/23/2007 7:43:22 AM
Hi
I need to update the collation on a database but its returning 'The
database could not be exclusively locked to perform the operation.'
How can lock the database so that I can make the change?
thanks
Lee
... more >>
Can a table column be used as a parameter?
Posted by ssciarrino at 3/23/2007 7:28:48 AM
Hope I can explain this.
I have a simple query to check the period totals for each month for projects
that are closed.
Here is the query:
SELECT a.project_id,a.component_id,a.cost_element_id,project_amt_1
FROM DBSproj.dbo.component_monetary_balance AS a, DBSproj.dbo.project AS b
... more >>
While Loop Question
Posted by Aussie Matt at 3/23/2007 6:48:03 AM
Hello, I am hoping you can help me out, I am teaching myself SQL and I have a
problem that I don;t understand the solution for, Attached is the stored
procedure.
The actual stored procedure run's and actually gives me the results I am
after, but it seems to run a little slow, I am wondering i... more >>
rest assure about the date
Posted by rodchar at 3/23/2007 6:40:05 AM
hey all,
i have this query that goes a little some like this?
select @testDate = dbDate
from Table1
where employeeID = 1
order by dbDate DESC
PRINT @testDate
Results:
1,2/17/07
1,7/18/06
1,1/17/06
Can i rest assure that @testDate is always going to be the last date in the
resultset?... more >>
Backup Information
Posted by nj at 3/23/2007 6:14:33 AM
Currently i am running below given query to get latest backup
information from backupset table
select TOP 25 database_name,MAX(backup_start_date) as
Backup_Start_Date ,
backup_finish_date,
'Backup_Type' = CASE type
when 'D' then 'Full_DB_Backup'
when 'L' then 'Transaction_Log_B... more >>
Help in writting query
Posted by Mukut at 3/23/2007 5:14:35 AM
Hi All,
We have a table called S_USER which is having a column named
LOGIN.This table contain Logins for more than 1000 users.
Now, after creating LOGINs & USERs we need to give SSE_ROLE to those
LOGINs. We wrote the below query for generating the sql for all those
logins(so that we can exe... more >>
Rows to Columns
Posted by S Chapman at 3/23/2007 3:12:56 AM
I have a table that stores data as EAV as follows:
--------------------------------------------------------------------
ID | Name | Str Value| Date Value| Num Value
--------------------------------------------------------------------
01 | Type | ABC | |
01 | Count |... more >>
how to connect to MDF file with classic ASP?
Posted by Bart at 3/23/2007 12:00:00 AM
Hi,
i have already posted this problem in an ASP newsgroup without succes, so i
try here.
I try to access within an cliassic ASP page an MDF file (newres.mdf) of sql
server express 2005 database which is located in
c:\inetpub\wwwroot\reskrosql\App_Data.
I get following error :
Provid... more >>
Order clause in a view differences between 2000 and 2005
Posted by E®!k Visser at 3/23/2007 12:00:00 AM
Hi all,
I have a problem with setitng an order clause in a view.
SELECT ID, SURNAME FROM CUSTOMERS
1 Visser
2 Lurker
3 Gates
CREATE VIEW Test AS SELECT TOP 100 PERCENT ID, SURNAME FROM CUSTOMERS ORDER
BY SURNAME
SELECT ID, SURNAME FROM CUSTOMERS
Now SqlServer 2000 gives
3 Gates... more >>
new to 2005 Service Broker question
Posted by fireball at 3/23/2007 12:00:00 AM
In book "Inside Microsoft SQL Server 2005" by Itzik, there goes, that it is
possible that receiving application and sending application _never_ work at
the same time (Chapter11 (I have only translation)). How is that possible to
deliver a message, if applications never run on the same time? I ... more >>
|