|
Try:
select 'grant execute on ' + name + ' to username' from sysobjects where xtype = 'P'
order by name Then run the resulting script (substituting the names of your users).
|
|
|
|
|
Hello Andy,
I have no idea what I am doing wrong but I keep getting the error
"Msg 207, Level 16, State 1, Line 1
Invalid column name 'CTTest'."
I just entered the command you have listed as such:
select 'grant execute on ' + CTTest + ' to ACM\ttomaselli' from sysobjects where xtype = 'P' order by name"
and the error pops up. I am certain this is what I need but why does it think that CTTest is a column when it is actually the database?
F
|
|
|
|
|
you have to use name
select 'GRANT EXECUTE ON ' + name + ' TO Bob' from sysobjects where xtype = 'P' order by name
|
|
|
|
|
Got it now.
|
|
|
|
|
Thank you all for your help!
Made it easy.
F
|
|
|
|
|
hi i all i have the following two Queries, i want to know the Difference Count Between these two Queries,by combining the query and display a difference.
SELECT COUNT(DISTINCT PROPERTY_KEY) PROPERTY_KEY
FROM sde.VW_Toi_Deeds_Vuyiswa
WHERE FUNCTION_KEY like '%GEOSS%'
GO .
SELECT COUNT(*) AS [UNITS IN PRO-V]
FROM SDE.PROPERTY
WHERE FUNC_KEY LIKE 'GEOSS%' .
THANKS
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://www.Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
This should illustrate the difference.
CREATE TABLE #foo (<br />
foo_id TINYINT )<br />
<br />
INSERT INTO [#foo] VALUES (1) <br />
INSERT INTO [#foo] VALUES (1) <br />
INSERT INTO [#foo] VALUES (1) <br />
INSERT INTO [#foo] VALUES (1) <br />
INSERT INTO [#foo] VALUES (2) <br />
INSERT INTO [#foo] VALUES (2) <br />
INSERT INTO [#foo] VALUES (2) <br />
INSERT INTO [#foo] VALUES (2) <br />
<br />
SELECT<br />
COUNT(*)<br />
FROM<br />
[#foo]<br />
<br />
SELECT<br />
COUNT(DISTINCT [#foo].[foo_id])<br />
FROM<br />
[#foo]<br />
<br />
DROP TABLE [#foo]
|
|
|
|
|
Thanks man,
But now this two Queries, is from Two tables,
thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Oh, sorry. I misunderstood your question.
This should do what you want then:
SELECT<br />
A.PROPERTY_KEY - B.[UNITS IN PRO-V]<br />
FROM<br />
(SELECT<br />
COUNT(DISTINCT PROPERTY_KEY) PROPERTY_KEY<br />
FROM<br />
sde.VW_Toi_Deeds_Vuyiswa<br />
WHERE<br />
FUNCTION_KEY like '%GEOSS%') A,<br />
(SELECT<br />
COUNT(*) AS [UNITS IN PRO-V]<br />
FROM<br />
SDE.PROPERTY<br />
WHERE<br />
FUNC_KEY LIKE 'GEOSS%') B
|
|
|
|
|
Thanks man it worked Perfectly
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi Leppyr64
i have to Display records not Count, how do i archive this. in the Above Query that you gave me.
SELECT
A.PROPERTY_KEY - B.[UNITS IN PRO-V]
FROM
(SELECT
COUNT(DISTINCT PROPERTY_KEY) PROPERTY_KEY
FROM
sde.VW_Toi_Deeds_Vuyiswa
WHERE
FUNCTION_KEY like '%GEOSS%') A,
(SELECT
COUNT(*) AS [UNITS IN PRO-V]
FROM
SDE.PROPERTY
WHERE
FUNC_KEY LIKE 'GEOSS%') B
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I don't understand what you want.
You asked for the difference between two queries that returned a number.
A - B = C
If what I gave you is not what you want then I need an example. I'm done guessing.
Please post DDL, Example Data, and Expected results.
|
|
|
|
|
Am Sorry,
Thanks.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I am getting error while fetching the data from sybase to SQL
TDS buffer length too large- oledb driver
Thanks & Regards
Avinash Mhase
Application Development
ZENTA
|
|
|
|
|
Hi,
The actual size of my database isn't enought, autogrow is activate and I can change the parameters but I want to increase from 6Go to 50Go. Do you know if there is a command or a procedure to resize the size of the database without to recreate a database.
Best regards
-- modified at 9:05 Tuesday 20th November, 2007
|
|
|
|
|
Using enterprise manager you can change the database file grow size or use ALTER DATABASE command.
see SQL Server 2005 BOL.
|
|
|
|
|
Hi:
I Mujahid Hussain Awan,I am a software Developer,I have a problem in Crystal Report.First I was working in
Visual Studio 2003(C#).I built many crystal reports using DataSet method,and the Procedure was so simple.First I add
Dataset and then add new element and give all it's attributes,and Datatype of all these attribute.then In Frontend at C#
I add new crystal report then I select Blank Report,then I open Field xplorer Window right Click on Database Fields
then I select Database Expert,a Database window Express Opens then I select Project Data and then I select ADO.net
DataSet a Dataset with the same I created above apears,then I open it and Drag & Drop each Fields in Crystal Report's
Detail Section.and then I Open a Form I initialize Dataset and Crystal report and write quer in Adapter then I Fill
DataSet and set DataSorce Property of Report Object.and set ReportSource property of Crystal report Viewer and run
Project and Record displays in Crystal Report. This is the Procedure of Crystal Report in Visual Studio 2003.
But When I do all these in Visual Studio with same Procedure but no Record Displays in Crystal Report.Can any body
Help me How can I do all this in Visual Studio 2005.
Mujahid Awan
|
|
|
|
|
so far i studied @@error and @@fetch_status , i know their utility.
But i don;t know what's the basic difference between @ and @@ parameters?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Sonia - you've been told this one before. @@ parameters are reserved system parameters. You can supply your own @ parameters.
|
|
|
|
|
ThanQ Pete
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
like avg(),sum(),and so on
i would like to see the source files
where exist these files?
thanks a lot
wuhuaiji
|
|
|
|
|
nibabug wrote: like avg(),sum(),and so on
i would like to see the source files
where exist these files?
Assuming you are using SQL Server, these files are part of the sourcecode so if you don't work for Microsoft then chances are you aren't going to have access to them. These functions are part of the SQL standard, not stored procedures.
|
|
|
|
|
hello everyone
i define a datatype float, but when i write a value, for exsample '1.123',to the table, then i find that the value in the table changed to '1.123999999999999', what's the problem?
thanks a lot
wuhuaiji
|
|
|
|
|
By default float size will be 8. Try reducing it
|
|
|
|
|
thanks ,
but it can not be reduced
wuhuaiji
|
|
|
|