While it is true IT people will only be running this procedure, I wanted it to be flexable enough to automatically pick up any changes made to the flat model (views) of the data without having to add the field to insert statement as well. Mainly a convience thing and so that there is less of a...
You are correct Karl, running one then the other works great and will probably be my final solution. Still would be nice to see how to finalize drop (or any other) commands while in an SP.
Thanks again.
Can't a view only be indexed in Enterprise edition though? At least that is what the documentation I read said. We only have standard edition :(
http://www.sqlteam.com/item.asp?ItemID=1015
Thanks for your help by the way guys & gals.
I tried adding the Drop statements in another SP but it still gave me the same problem.
I also do not contest SQLSisters concerns, I just don't think they will matter in my case as I am not matching any of her scenarios. I am sorry to get you all wryled up, it is hard to explain your exact...
...Think of it as a maintenance tool only.
The view is based on many many tables to flatten data out for reporting. By the way, the select * in the insert statement should be fine since it is supposed to be first dropping the table then recreating the table structure and not blinding inputting...
That is true, in QA it does work with a GO. However, I need this in stored procedure so that another person can call it and refresh the data whenever he needs to, even put it on a timed process if he has to.
...kind of like the Drop Table command isn't executing at all or in time. What am I missing?
Create Procedure spSyncTest
As
If Exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tbl_Indexed_Scores_Combined]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
Exec('Drop Table...
You are correct r937,
Kevin's solution would return the same results only on a table where the two fields together formed a unique value using either a primary key or other unique constraint. That way you would never return rows that have duplicate data and avoid the situation you suggested...
...that matched only those values.
My friend Kevin also came up with this statement that does the same thing. So now we have two ways !
Select *
From tblUser
Where
EXISTS (
Select idUser
From tblUser_Permission
Where idUser = tblUser.idUser
And idPermission in...
Say I have a link table with two fields, idUser and idPermission, I would like to know how to Select just the users that have a set of permissions. For instance getting just the users that have idPermission of 1, 2 and 3.
idUser idPermission
------ ------------
1 1
1...
Sorry, no resolution to the original question.
I would like to know how you set the permissions on those registry keys. I just loaded up an NT4 machine to test some software and the user rights section is very limited.
I appreciate any help.
-Matt
You could always use the FileSystemObject.
This code works like a champ :
(remember to include the ScriptingRunTime in your project)
Dim oFSO As Scripting.FileSystemObject
Private Sub Form_Load()
Set oFSO = New Scripting.FileSystemObject
iterate "c:\3pm"
End Sub
Private...
How or can you export functions in a VB(ActiveX) DLL so that you can call them using the 'Declare' statement in Visual Basic as you would using API functions?
I know VB creates 4 exported functions already in it's ActiveX DLLs for registering and unregistering and createing and releasing...
To clarify,
That is a peice of code I used to change names of files.
Just change the
oFile.Name = "_" & oFile.Name
portion of it to something that will hold your file names.
-Matt
Use the FileSystemObject, it works like a champ.
----
Dim oFSO As Scripting.FileSystemObject
Private Sub Form_Load()
Set oFSO = New Scripting.FileSystemObject
oneFolder App.Path & "\files"
End Sub
Private Function oneFolder(ByVal sDir As String) As String
Dim oDir As...
It looks like you are trying to use an ADO control to traverse through your data. I would recommend dumping the control and just using the ADO's connection and recordset objects.
Dim oCon as New ADODB.Connection
Dim oRs as New ADODB.Recordset
Then code your load event to open the connection...
Ok, what is the error exactly? Is it something like 'Can't create ActiveX Object'? If it is then make sure the dll/ocx that the class resides in is properly registered on that machine.
-Matt
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.