My website host allows me to create DB and DB users from its control panel and then I am able to use SQL server Management studio to Manage My DB.
Therefore I create My DB (TBC20) and create a user for it(Tony) from Host Panel.
When I want to Export My Local copy DB data to the remote DB using Import/Export wizard and set the It won’t Generate any DB objects. Even When I use aspnet_regsql Command I encounter Following error:
SQL error number is 262 and the SqlException message is: CREATE DATABASE permiss
ion denied in database 'master'.
Creating the TBC20 database...
------------------------------------------------------
When I View permissions in Database properties window No Permission is Grant for user: Tony. Only some permission Grant for Grantor: dbo. When I check Boxes to Grant Permission for user Tony None of permissions will be grant to this user.
How could I allow this user ti take ownership of DB and create DB objects
I will have a group of developers creating objects in a database. Currently they all create them with the SA account. I would like to have them mapped to the dbo or some method that when they create objects all objects are dbo.object name and not h1fed99.object name. Is there a good methor or practice to handle this
Hi, can we use sqlcmd.exe (successsor to osql) to run sql scripts against a compact edition database? Would like to use the output from Visual Studio Team Edition for Software Professionals to build the database structure on compact edition database.
Hi All, I have a SQL script which has creation of some table variables. When I run this query in Query Analyzer, I get proper results. But, when I use the same script to execute from VB Script, it is not running at all. I tried a simple select statement which works fine; but with the one I want to run, it fails to run. I am trying to print the SQL script from VB script, and it appears to be fine. I think the creation of DB objects is where it is getting stuck. Any help here please??
Below is the SQL Script.
Code Block DECLARE @COMPSINGRP TABLE (NAME VARCHAR(100)) INSERT INTO @COMPSINGRP SELECT NAME FROM COMPUTER WHERE IDCOMPUTER IN (SELECT INSTANCEID FROM [FN_COMPUTERSINGROUPLIKENAME] ('UBS: APPLICATIONS - DEALAXIS') ) DECLARE @COMPRESTARTS TABLE (NAME VARCHAR(100)) INSERT INTO @COMPRESTARTS SELECT COMPUTER FROM ( SELECT C.Name AS COMPUTER, --- FIRST COLUMN (SELECT AC.Description FROM Computer CC INNER JOIN [fn_ComputersInGroupLikeName] ('UBS: Applications - DealAxis') CCG ON CC.idComputer = CCG.InstanceID INNER JOIN Alert AC ON CCG.InstanceID = AC.idComputer WHERE (AC.Description Like '%down on a scheduled maintenance%') AND CC.Name = C.Name AND (CONVERT(NVARCHAR(12),A.TimeOfLastEvent,111) = CONVERT(NVARCHAR(12),GETDATE(),111) )) AS DOWN_DESCRIPTION, --- SECOND COLUMN (SELECT AC.Description FROM Computer CC INNER JOIN [fn_ComputersInGroupLikeName] ('UBS: Applications - DealAxis') CCG ON CC.idComputer = CCG.InstanceID INNER JOIN Alert AC ON CCG.InstanceID = AC.idComputer WHERE (AC.Description Like '%successfully up now after a scheduled reboot%' ) AND CC.Name = C.Name AND (CONVERT(NVARCHAR(12),A.TimeOfLastEvent,111) = CONVERT(NVARCHAR(12),GETDATE(),111) ) ) AS UP_DESCRIPTION --- THIRD COLUMN FROM Computer C INNER JOIN [fn_ComputersInGroupLikeName] ('UBS: Applications - DealAxis') CG ON C.idComputer = CG.InstanceID INNER JOIN Alert A ON CG.InstanceID = A.idComputer WHERE (CONVERT (NVARCHAR(12),A.TimeOfLastEvent,111) = CONVERT(NVARCHAR(12),GETDATE(),111) ) --ORDER BY C.NAME ) AS RESTARTS DECLARE @NOCLUE TABLE (NAME VARCHAR(100)) SELECT 'The Server '+ NAME+' did not have any restart information. Please Check.' FROM @COMPSINGRP WHERE NAME NOT IN (SELECT NAME FROM @COMPRESTARTS)
Any help or suggestion would help me out. Thanks a lot.
How to SQL server save information about create/drop objects action. How can I get this? Example for, a lot of objects(sp) in my database has been dropped, how I know who was dropped them (user login & time)?
I just upgraded our existing 6.5 installation with the new SQL server 7.0. I can't get any of the existing stored procedures which I imported from 6.5 into 7.0 to allow me to edit them. I do all of my design from Visual InterDev and the SQL Server 6.5 version would allow me to create and edit stored procedures. It would also allow me to create/design new tables.
With SQL Server 7.0 I do not have an option to edit or create any of these items. I have created a new login, assigned it a password, given it admin rights/roles and I am still unable to remotely create these items. What am I doing wrong?
Hi,I have to prepare an ER diagram for the objects in my SQL Serverdatabase. I have used the option "DIAGRAMS" in EnterPrise Manager ofSQL Server 2000. It is creating the diagram for the selected tables(but the diagram contains only the table which i have selected. It isnot displaying its depended tables). But i am not able to export it toany of the flat file like MS WORD or paint. I want this diagram to beuploaded to one Flat file and send to my customer for his reference.Could anyone suggest me how to create the ER Diagram for the SQL 2000database and export it to a flat file.Thanks for your help in advance.-Rao
MySql has a statement like: SHOW CREATE TABLE tablename;
that returns the precise CREATE TABLE statement for the specified tablename.
Sql Management Studio also allows scripting Create Statement for any object by right-clicking it. But I want to do this programatically, and fetch CREATE statements for Tables, Procedures & Views.
How can I retrive CREATE statements for Database objects progrmatically in Sql Server???
Is there a way to give someone the right to create only views and no other objects in a database? Currently I have given the individual ddladmin database rose, but would rather be more restrictive?
I use SQL code snippet to attach the CLR assembly (dll) to the SQL Server Express
CREATE ASSEMBLY [DatabaseAndImages] AUTHORIZATION [dbo] FROM 'C:CLR_File.dll' WITH PERMISSION_SET = SAFE
That file content CRL Codes for 10 Stored Procedures & 3 UDT & 5 Functions & 6 Triggers As you can see it's content large amount of DB objects !!
My Question is .. Is there any simple way can I use it to extract or automatic create all that Objects in the Database without use separate SQL Statement for each one ??
By Example , I will use this SQL statement to create the sp_AddImage that already located inside the CLR dll file
CREATE PROCEDURE [dbo].[sp_AddImage] @ImageID [uniqueidentifier], @ImageFileName [nvarchar](max), @Image [varbinary](max) WITH EXECUTE AS CALLER AS EXTERNAL NAME [DatabaseAndImages].[StoredProcedures].[sp_AddImage]
But as you know .. I have many objects .. and I am in development phase and I will do change to that object many time and also may I will add much more €¦
I thing it's not good to write SQL Statement for each object and do changes every time when I change the object definition
Is there any one line of SQL statement can I use it to automatically create and extract all the objects inside the assembly ?? Or is there any way to do that Issue by simple operation ??
We are in the process of trying to automate our production releases (what a concept ;-)
The database is SQL server 2005 All objects are being stored in VSS Using Nant and Cruise Control for the actual migrations. I have two directories - Create (for a brandnew database) and Change (db object changes)
In my 'Change' script, I do the following -
1 - Take backup of database 2 - Migrate objects from 'change' directory to production 3 - Script out all objects of database and save in the 'Create' directory
For the #3, I was hoping I could create an SSIS package that would script out all database objects and save them on the VSS server.
I'm new to SSIS and want to verify it's something that can be done before I start down that path. If anyone has any examples or references, it would be much appreciated.
I create a logon trigger on a sql server 2008 r2 instance,the trigger is very simple,like this:
CREATE TRIGGER tg_login ON ALL SERVER FOR LOGON AS IF ORIGINAL_LOGIN() IN('sa') AND HOST_NAME()='TestHost1'
[Code] ...
I use master.dbo.LoginRecord table to record the bad logon. When the trigger is working ,latches produced sometimes,wait type is PAGELATCH_UP and wait resource is 2:1:3. At this time, a large number of logon failed ,error message is "Logon failed for login 'login name' due to trigger execution."
I think logon trigger create internal temporary objects maybe,it is right?
please help newbieI need to create a lot of objects the same type (let's say: schemas)I wish to use paramerized block in loop to do so.- how to put names of my objects to such control-flow?belss you for help
I am getting the following error when executing a Copy SQL Server Objects Task. If it helps these objects are User Defined functions and also this had worked in the past it is only after changing the destination server to one that is offsite, has a different OS then the source and also runs as a DC. We are running SQL 2000 Server Standard with Spk 3a on both boxes.
Step 'DTSStep_DTSTransferObjectsTask_6' failed
Step Error Source: Microsoft SQL-DMO (ODBC SQLState: 42S02) Step Error Description:[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetRightsAbbreviations'. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetRights'. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTerritoryAbbreviations'. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTerritories'. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetShow'. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTvEpisodes'. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTvSegments'. [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTvSegmentsString'. Step Error code: 800400D0 Step Error Help File:SQLDMO80.hlp Step Error Help Context ID:1131
I'm trying to copy all tables (including indexes, triggers, etc) from one db to another using the transfer sql server object task.
I seem to able copy small amounts of tables (sometimes), but when I select ALL the tables, I get this handy error:
"The requested objects failed to transfer"
I had a few problems when trying to copy certain tables that had foreign keys, but that's sort of expected: you can't stick a key onto a table that references another table that doesn't exist!
I get this error when trying to copy a few tables that do have keys. There are no primary or candidate keys in the referenced table 'Table1' that match the referencing column list in the foreign key 'FK_Table2_Table1'
Now, Table1 does have primary key on the source, but it seems to want to create the foreign key on Table_2 before the primary key on Table_1 has been created!
We will be moving 2 different databases (SS2005 & SS2008) to a new SS2014 SQL Server.  Currently our codes looks something like Server1DBInstance1... & Server2DBInstance2... Is it possible to move the objects from these 2 instances to Server3DBInstance3 and then use an alias to reference the objects?  Or does Server3 need to have DBInstance1 & DBIstance2?  Basically, is the alias just for the database or for the instance too?  Can I create an alias "Server1DBInstance1' on Server3DBInstance3 and assign objects to that alias?
I've just installed SQL Server 2005 Developer Edition, upgraded from SQL Server 2000, and have encountered a problem in trying to query against the System Catalogs.
I've tried SELECT * FROM sys.objects in addition to SELECT suser_name( role_principal_id ) FROM sys.server_role_members. In both cases I receive the following error: Invalid object name 'sys.objects' or 'sys.server_role_members' in the second example.
I changed the properties of the registration for my local db instance to use SQL authentication in lieu of Windows authentication. I used the sa login account to see if that made a difference, no go.
Can someone *please* tell me what I'm doing wrong here?
I would also like to know if it's possible to run a query confirming the user account I'm logged in to the system as.
i am copying objects from one DB to other usign Transfer SQL Server Objects Task. i am getting this error
[Transfer SQL Server Objects Task] Error: Execution failed with the following error: "ERROR : errorCode=-1073548784 description=Executing the query "DROP TABLE [dbo].[testCopy] " failed with the following error: "Cannot drop the table 'dbo.testCopy', because it does not exist or you do not have permission.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}".
it is true that object doesnt exist on the destination. but i want it to see if the object is there then drop otherwise just copy the object there,
passing serialised objects to a stored procedure for the purpose of data inserts. I see this as being a way to handle multiple row inserts efficiently.
However, in my limited use of XML data I am not so sure how to link the data when I have a dependency on another "object" within the serialised XML.
Below is a code snippet showing what I have so far.
The first insert statement works fine - but how to retrieve the identifier created by the DB - I want to use an SQL statement that finds the record in the table based on the XML representation (of the PluginInfo), allowing me to insert the ConfigurationInfo with the correct reference to the PluginInfo
DECLARE @Config NVARCHAR(MAX) DECLARE @Handle AS INT DECLARE @TransactionCount AS INT SELECT @Config = ' <ConfigurationDirectory > <ConfigurationInfo groupKey="Notifications" sectionKey="App.Customization.PluginInfo"
Sorry seem to be havign no end of trouble with SQL today. I need to create a query that will rank tickets using the row count of another table which has a relationship with the primarykey of that ticket table. I decided to spilt it into two querys, one which gets the count each ticketid has within a date peroid and relating to a os:: SELECT COUNT(*) AS count, Tickets.TicketID, Systems.OSFROM Rating INNER JOIN Tickets ON Rating.TicketID = Tickets.TicketID INNER JOIN Systems ON Tickets.SystemID = Systems.SystemIDWHERE (Rating.DateVoted >= @date)GROUP BY Tickets.TicketID, Systems.OSHAVING (Systems.OS = @osid) This works, BUT when I put in the date using: command.CommandText = "SELECT COUNT(*) AS count, Tickets.TicketID, Systems.OS FROM Rating INNER JOIN Tickets ON Rating.TicketID = Tickets.TicketID INNER JOIN Systems ON Tickets.SystemID = Systems.SystemID WHERE (Rating.DateVoted >=" + Datetime.Now.Adddays(-7) + ") GROUP BY Tickets.TicketID, Systems.OS HAVING (Systems.OS =" + 1 + ")"; And it throws up an error saying there was a syntax error at '22' (the hour I am currently on). So: Any idea how I can fix thisAny ideas on creating a query that will do the above, but also return the ticket informationHow do you link querys (I might have to do this if I can't work out 2)Please, If anyone has any ideas. This is driving me crazy
I don't believe that the fix to the above issue has made its way into an SP yet. Can anyone confirm/refute this, and/or state when the fix will become publicly available &/or give a workaround?
I'm trying to copy data over using a Transfer SQL Server Objects Task however I get problems trying to copy over views. I get the similar error (pre sp1) when using import/export wizard and copying over views. Now with SP1 the views just don't transfer. I'm transferring from SQL 2005 to SQL 2005. The error I get is:
Error: 0xC002F363 at Transfer Data (NEW), Transfer SQL Server Objects Task: Table "vw_XXXX" does not exist at the source. Task failed: Transfer Data (NEW)
I know the view exists at the source because:
A) I can select it in the Views List Collection within the Transfer SQL Server Objects Task B) I'm using the view on the source
Somehow the views are not transferring. Anyone have any ideas?
Hello, I am running a package that used to transfers data from one SQL2005 to another SQL2005. There are multiple schemas associated with the database. Until recently, this pacakage would work. Now I am getting the following error for all the tables not owned by dbo:
Any help on this would be appreciated.
Thanks, sck10
[Transfer SQL Server Objects Task] Error: Table "tblAudiocast" does not exist at the source.
Microsoft SQL Server Management Studio 9.00.3042.00 Microsoft Analysis Services Client Tools 2005.090.3042.00 Microsoft Data Access Components (MDAC) 2000.085.1117.00 (xpsp_sp2_rtm.040803-2158) Microsoft MSXML 2.6 3.0 4.0 5.0 6.0 Microsoft Internet Explorer 7.0.5730.11 Microsoft .NET Framework 2.0.50727.832 Operating System 5.1.2600
Does anyone know what could be causing the error on Transfer SQL Server Objects Task? I tried to develope a SSIS project in the Business Intelligence studio to transfer table between databases on the same server. However, I have been getting the following error:
[Transfer SQL Server Objects Task] Error: Table "XXXXXX" does not exist at the source.
Is there a setting that I need to change to make this work? Thank you for your help.
I wanted to create a package to copy the objects from one database to another and replace those object if they already exist. Therefore, before the package executes you do not know whether all the objects exist on the target server or only some of them.
Using the 'Transfer SQL Server Objects Task' I have found that I cannot get this to execute cleanly by itself. If I set the 'DropObjectsFirst' to false then an error is thrown if the object exists and if I set it to true then an error is thrown if it does not exist.
In order to get round this I have had to create an 'Execute SQL Task' to list all the objects and then go through them dropping them on the target server in a for each loop before executing the 'Transfer SQL Server Objects Task' with 'Transfer SQL Server Objects Task' set to false.
However, is there a better way of achieving this or am I missing something in the 'Transfer SQL Server Objects Task'?
This is a problem I encountered when I had to detach a database file (type .mdf):
1) I went to the MS SQL Management Server Studi and detached my database file successfully from a connection called Workhorse.
2) I needed to place the .mdf database file into a zip file in order to put it on a remote server. I did this using Shared Portal. This was also successful
3) However when I tried reattaching the database file, I got this error:
CREATE FILE encountered operating system error 5A(Access denied.) while attempting to open or create the physical file "CProgram FilesMSSQL ServerMSSQLData<databasename>.mdf'
Q) The database file and log file (ldf) exist in the correct directory so I don't know what happened. Can any one help?
I was trying to transfer a SQL Server 2000 database to SQL Server 2005 using SQL Server Objects Task. However, The following error message was encountered: "[Transfer SQL Server Objects Task] Error: Execution failed with the following error: "Cannot apply value null to property Login: Value cannot be null..".€œ