I modified the trigger template in SQL Server Enterprise Manager.
How to restore default trigger template,like follow
--------------------------------------------------------
CREATE TRIGGER [TRIGGER NAME] ON [dbo].[tablename]
FOR INSERT, UPDATE, DELETE
AS
--------------------------------------------------
Does the information of trigger template save in a file ?
Anyone has idea ?
How can I restore the original User Defined Function Template? I madean error and saved one of my UDFs as a template but would like theoriginal template restored?TIA
I would like to standardize SSIS development so that developers all start with the same basic template. I have set it up so it is an available template ( http://support.microsoft.com/kb/908018 ) but I would like it to be the default when a new project or package is created. Is this an option?
I am trying to scrub a SQL DB to start with a fresh installation of dotnetnuke. I use hosting, so I have to use the current database that has a ton of useless tables in, becuase I don't have rights to create a new one. Is there a way to revert a DB back to the state it was wehn firstly created? Thanks!
How can I restore the default setting for MSDE to have only Windows Autentication and not mixed mode? And to have my sa account without password? Please help me! Thanks, Nibbles
Hello. I am trying to perform a backup and restore of a user's default database. the user- "myuser", was created with a default database. I have backed the user database and tried to restore it in different ways and I always get the same error when trying to connect with the user after restore:
"Cannot open user default database.Login failed (error 4064)".
It happens if I don't delete the user before restoring the database.
If I try to delete the user before restore and create it afterwards, when I try to set the default user database to the same database I get the error:
"user, group or role 'myuser' already exist in the database"
And when I try to delete the user from the restored database (in order to recreate it) I cannot, because the user's schema is connected to objects in the database.
Can anyone help?... How do I restore?? Thanx, Nili.
I am confused regarding why the default behavior of this option is to use file no 1 if the option is not specified? If I take two backups on different days, weeks, months, etc. and write them to the same Backup set, the second and most recent backup by the way gets the higher file number (position) as one would expect. What is incomprehensible to me is why the decision was made to restore the oldest backup from the backup set if you do not specify with file no? Seems like common sense that I would NEVER want to restore the oldest backup by default and would most-likely always want to restore the most recent backup by default!
If anyone has suggestions on how I could suggest that the behavior of this option be changed, I would appreciate it, as this has caused me much pain.
Is there any way that I can execute a command after a database is restored? I need to be able to embed this into the database so that when it's restored on any computer, it updates a value in a table.
Hello. is there an event that exists for server level triggers when a database restore occurs? I don't see restore_database as an option in BOL... I DO see
CREATE_DATABASE
ALTER_DATABASE
DROP_DATABASE
Any way to fire a server trigger on a database restore?
We're capturing the other server events but would like to also log and be notified of database restores. Thanks, Bruce
I need to import data from a CSV file into a db I'm designing. I figured I'd use DTS (which I understand now uses VS in the form of a 'Business Intelligence' (BI) project). My problem is that my only choices for BI projects are: Analysis Service Project, Import Analysis Services 9.0 Database, Integration Services Project, Report Server Project Wizard, Report Model Project, Report Server Project. No "Data Transformation Project". I have SQL Server 2005 Developer's Edition. Might it be that DTS is not included in that version? If I can't use DTS, what choices do I have?
Hi! I'm new to SQL Server 7 and I hope I could get some help. I'd like to duplicate an empty database and use the duplicate for the transactions. I want the empty database to somehow act like a template so, whenever I want to, I could create a new instance of it. Problem is I don't know if it is possible to do that on SQL server (it's possible in Access). If it is possible, I hope any of you could tell me how. Thanks.
I'm having a hard time trying to figure out how to run the logtemp.sql script that is included with IIS4 for ODBC logging. Any help would be appreciated.
In Enterprise Manager when I bring up Trigger Properties there is an active button titled "Save as Template". But when I switch to an existing trigger the button is disabled. Oddly, the Help file for the dialog box doesn't even mention this button.
Anybody know what this does, how it works, or why it would be usefull? Any references to The Holy Book would be helpfull.
how can I specify the number of records that have to be sent back dynamically in an Xml Template?
I am currently busy developing a client-server application that pulls data from an Sql Server via Xml. If the client application has a bad connection to the server, the program has to get the data in small portions.
When I use:
SELECT TOP @amount * FROM employees
I get the error: syntax near '@amount'.
The query fails as wel when I tried to use:
SET ROWCOUNT @amount
SELECT * FROM employees
SET ROWCOUNT 0
This works fine in Sql analyser, but sql doesn't allow the integers to be parameters and casting them to int does not work either.
Hi, Is there any way to change path for template explorer? Default path for SQL templates is ..Application DataMicrosoftMicrosoft SQL Server90ToolsShellTemplatesSql. I have scripts & would like to share with my teammates. Is there any way to set this path to a common folder so that whenever anybody connects with their login to our TS server, they should be able to see these scripts in template explorer.
Hi,Suppose I have a table something like:name (VARCHAR(64)) age (INT) quotation (TEXT)=================================================Donald Trump 50 I am richBugs Bunny 26 What's up doc...and a template string something like:SET @template = 'My name is {name}, my age is {age}, and I always say"{quotation}".'I'd like to be able to dynamically replace the placeholders in thetemplate string with values extracted from the corresponding columns inthe table, so I'd get a set of results like:'My name is Donald Trump, my age is 50, and I always say "I am rich".'The best I've come up with so far is:SET @Query = 'SELECT '''+ REPLACE(REPLACE(@String, '{', '''+CONVERT(varchar,'),'}', ')+''')+ ''' FROM Table'EXEC (@Query)This converts the template string into a query string, castingeverything to avarchar to allow numeric values to work. In this case it would be:SELECT 'My name is '+CONVERT(varchar,name)+', my age is '+CONVERT(varchar,age)+', and I always say "'+CONVERT(varchar,quotation)+'".'The problem with this is that if the length of a varchar isunspecified, it defaults to 30, which truncates long string values.Can anyone figure out a way round this, or perhaps an alternativemethod entirely?--Oli
FETCH NEXT FROM <@variable_cursor_name, , @test_cursor_variable>
PRINT 'put user defined code here'
END But even after instantiating it - it doesn't work. The "FETCH_STATUS" must be seeded with a prior "FETCH" before it has any meaning. This leads me to ask: (1) how could such a widely circulated template have such a conspicuous error and (2) why doesn't TSQL have a looping mechanism that does not require such awkward FETCH "pre-seeding"? p.s. How do I insert code into a forum post that is single-spaced, rather than duoble-spaced (like my ugly double-spaced snippet above)
I have created a template like report which is all working correctly. The report shows a order slip for all orders that are in a certain pick, and has a list of all products for each order. (so a list of products is printed for each order in the pick)
The question I have is, when the order is very long ie doesnt fit in 1 page, I need someway of the user easily knowing that there is more than 1 page... ie it should be Page 1 of 2... but in the whole report it may be Page 56 of 60.... is there a way of doing this??? or something similar...
I hope i have made myself clear... and would be VERY garteful for any ideas, im bit lost!...
I read the steps on creating a package template and using that template in future Projects.
My question is, how is doing Add -> New Item from the solution different from Add Existing Package from SSIS Packages. Other than the quicker navigation, I see no difference. So, is that it?
I have Visual Studio 2012 (Ultimate) installed (Update 4) with SSDT (version 11.1.50512.0), I can see the template SQL Server Database Project, but where is the server-level project, SQL Server Project?
Previously, in Visual Studio 2008, I had a Category Database Projects with subcategories for SQL Server CLR, SQL Server 2000, SQL Server 2005 and SQL Server 2008. Each of those had a SQL Server 200x Server Project template.These seem to be missing in Visual Studio 2012.
Hi. I'm running VS2005 and trying to use the SQL Database installed template (right-click my project in Solution Explorer / Add / New Item / SQL Database template ("An empty SQL database for local data") to create an MDF file per the "AbsoluteBeginner-Lesson08" video available on MSDN. When I click "Add", I get an error stating that "Connections to SQL Server files require SQL Server Express to function properly. Please verify the installation of the component or download from the URL: http://go.microsoft.com/fwlink/?LinkID=49251". I'm running SQL 2000, SQL 2005 and SQL Express 2005 (all work and can be hit from Management Studio) on 2003 Server. I'm assuming that it's because the Express instance is a named instance, not the default but I can't find any references. Anybody else had this probelm? Thanks.
i use quite some number of lookups for almost all of my fact tables ETL.
i was wondering if i can create a template or something similar so i can reuse the lookup instead of creating it again in each data flow for the fact table..
HI I want to create a report template in SQL Server 2005 Reporting Services. The template will have a fixed header and footer.I want to use this template in all my reports. How to do so?
Hello,I need to be able to CREATE DATABASE by copying an existing database.I would be doing this inside of a web app during an event.How do I set this up on SQL 2005 ?Thanks!Here's an article on how to do it in PostgreSQL http://www.enterprisedb.com/documentation/manage-ag-templatedbs.html
I accidentally altered the CREATE TABLE template from SQL Server Management Studio Express. Now I don't have the original. Could somebody please post CREATE TABLE template.
Hi All, I'm working on a web application where the user needs to be able to create and name new databases that are identical in structure to other existing databases (that is, all tables, stored procedures, functions, indexes, etc.). This is so that they can create a new database for each client and need to be able to do this through the web application. Having hunted around a fair bit, I've established that SMO is capable of doing pretty much everything that I want. The only problem is that everything I do seems to be based on the actual SQL Server and associated databases rather than the ones I have created in the App_Data folder. The relevant code (so far) is:Dim sqlServer As New Server() With sqlServer.ConnectionContext .ServerInstance = "(local)" .Connect() .Disconnect() End With
For Each db As Database In sqlServer.Databases ListView1.Items.Add(db.Name) Next
Dim newDatabase As New Database(sqlServer, DbName.Text.ToString) newDatabase.Create() This does actaully create a new database, just not where I want it! Can anyone point me in the right direction as to how I can create a copy of a database in the App_Data folder? Thanks & regards, Paul
When I go to create a new stored procedure, function, etc. I get a default template... is there anyway to replace this template with one of my own? One that will already have the important information pre-populated (the stuff I always end up having to type in, like company name, etc.).
I need some feedback on how this sql is perfroming a cast. I have used CAST before, but I amlooking at a stored procedure, and the CAST looks slightly different. Usually when I do acast, it is of the form CAST(ColumnName,DataType) but this cast is slightly different as theyappear to be using some type of template to cast with. Here is the code. I will put line numbers in for reference.
1 CREATE TABLE #Groups2 (PartyId uniqueidentifier)3 INSERT INTO #Groups (PartyId)4 SELECT PartyId5 FROM ttg_sfGroupsByPartyId(@PartyId)67 IF (@PortalId = CAST('00000000-0000-0000-0000-000000000000' AS uniqueidentifier) AND88 @TabId = CAST('00000000-0000-0000-0000-000000000000' AS uniqueidentifier))0 BEGIN Also just to let you know, the the values PartyId, and PortalId are GUIDS. So, I guess my question is, are they using a kind of template to format the data? So look at lines7 and 8. Are they using some type of template to signal the compiler, that the data will be of thatformat and will be seperated by dash symbols?