Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
11 votes
4 answers
86k views

script to show all the permissions for a table

inside my database I have a procedure called spGen2_tblIE_SchedProcess_Update. when I run this script select * from sys.objects where name = 'spGen2_tblIE_SchedProcess_Update' Inside the same ...
Marcello Miorelli's user avatar
7 votes
3 answers
18k views

Restore All Databases Script

I am migrating SQL Server DBs to a new instance. I have been told that it is possible to dynamically build a RESTORE script from available backups in the system catalog. Does anyone know of a sample ...
K09's user avatar
  • 1,414
4 votes
2 answers
5k views

how to script out the user defined table types?

I can Get name and definition of all table types using either of the following scripts: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED IF OBJECT_ID('TEMPDB..#RADHE') IS NOT NULL DROP TABLE #...
Marcello Miorelli's user avatar
2 votes
3 answers
9k views

Postgresql Backup all databases separate files

I need to create an automatic backup of all databases from PostgreSQL (running on a Windows machine). I need to know if it is possible to get a backup of all databases but in separate files. Using ...
Anisa Ibro's user avatar
2 votes
1 answer
185 views

Trace flag is running, but not message when deadlock happens

Trace flags are used to temporarily set specific server characteristics or to switch off a particular behavior More information on the trace flags are here DBCC TRACESTATUS this above, is the ...
Marcello Miorelli's user avatar
2 votes
3 answers
9k views

Script to backup all databases

I'm working on automating backups of SQL Server databases on SQL 2008 R2 Express. These backups are initiated daily by the Windows Task Scheduler, which execute a batch file, which in turns executes a ...
Jerry Dodge's user avatar
2 votes
1 answer
2k views

How to automate the changes of parameters in ssis package run by a job?

I have a job that runs a package with specific parameters as you can see on the picture below: I want to set up those parameters (the 2 dates in yellow) to 1900-01-01 instead of 2019-02-27. I need ...
Marcello Miorelli's user avatar
2 votes
0 answers
937 views

How do I create an automated SQL Server restore script for multiple backups? [duplicate]

I basically have 6 daily SQL Server backups (.bak) that need a restore everyday. I want to automate this process by having the SQL Agent run the script daily. I have the following restore script ...
Yen K's user avatar
  • 21
1 vote
2 answers
603 views

How to script server level objects in sql server?

I regularly do sql server installations (mainly sql server 2016), in virtual machines or otherwise, and I have a bunch of things like permissions, and linked servers and endpoints that I have mostly ...
Marcello Miorelli's user avatar
1 vote
1 answer
3k views

MySQL dump to MariaDB issue with collation

I have a django app running on a staging server (windows server 2012) with a MariaDB database. I have a git hook running mysqldump locally when I push to the staging branch. On the server I have a ...
Samoht's user avatar
  • 13
1 vote
1 answer
275 views

How to upgrade a MySQL database using numbered scripts based on a version field

I have a database that contains a version table with one value stored in it which is the database version number. I would like to be able to update the database version automatically using numbered ...
Mark Smith's user avatar
0 votes
1 answer
6k views

SQL Mail Failing To Send

SQL Sever 2016 with the latest updates. Running on WS2012R2. Following error message is received: The mail could not be sent to the recipients because of the mail server failure. (Sending Mail ...
DARKOCEAN's user avatar
0 votes
1 answer
430 views

how to script server side permissions - specifically EXECUTE ON SYS.XP_PROP_OLEDB_PROVIDER?

I could not script the following server side permissions: GRANT VIEW DEFINITION ON LOGIN::[site_helpdesk] TO [Radhe] but thanks to the question below I found a solution to that: How to script out ...
Marcello Miorelli's user avatar
0 votes
1 answer
687 views

Error with dbatools

Trying to export SQL Objects via DBAtools in Powershell. Get-DbaAgentJob -SqlInstance 'TestServer01' -Job 'mydatabase-daily-backup' | Export-DbaScript -FilePath C:\temp\mydatabase-daily-backup.sql ...
Prakash's user avatar
0 votes
1 answer
2k views

View the role assigned to each user (Report Server)

Is there anyway I could list down the roles assigned to each user on the different folders on ReportServer Database and in that SQL statement I should be able to declare something like @User_Name ...
Heisenberg's user avatar
  • 1,505