|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
An Interesting Conversion | |
What is the result from this code?
SELECT CONVERT(nvarchar,N'123456789012345678901234567890!') | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
Saving Labor I have a database with over 100 stored procedures. We want to be sure we capture the text in files for version control. What is the easiest way to get the text of all stored procedures into separate files without spending a lot of time. Answer: Right click the database, select Tasks, Generate Scripts, and save each procedure to a separate file Explanation: The easiest way to get over 100 files saved with the stored procedure code is to use the Generate Scripts option in SSMS. This allows you to pick stored procedures and save each to a separate file. Ref: Generate Scripts - https://docs.microsoft.com/en-us/sql/ssms/scripting/generate-scripts-sql-server-management-studio?view=sql-server-ver16 |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2016 - Administration |
SQL Multisubnet DNS issue - Hello We have a situation where we need to setup AlwaysOn configuration in hybrid mode (2 servers on on-premises and 2 on Azure hosted hosted under same cluster) with listener having 2 different IP's from 2 different subnets (one IP of Azure subnet and other of on-premises subnet) Since we had application connection issues we […] |
non-sysadmins have been denied permission to run cmdexec job steps without a pro - Hello Some of the devleopers need to run xp_cmdshell. These are the steps followed, still have the error as: "non-sysadmins have been denied permission to run cmdexec job steps without a proxy account" Created a windows group account 2. Under credentials, added the account as proxy 3. Under agent jobs, under CmdExec, added the proxy […] |
SQL Server 2016 - Development and T-SQL |
Finding first record that meets conditions + allowing grouping - Just want to explore the best way to pick the "first" record from a table that meets certain conditions, while at the same time allowing grouping to occur. As one example, consider a "planting" scenario where one needs to know the first month it is safe to plant seeds in different cities. Assume the temperature […] |
Is It Possible to Join a Table-Valued Function w/Param To DB table - If I have a TVF (Table Valued Function) that accepts a date as a parameter I can join it to a Regular DB table if the value passed into the TVF is a fixed date so I can either use GetDate() or I can assign a date to a variable and pass the variable into […] |
Modify Trigger to take values from inserted except for 1 field - I am working with a system that has audit trail triggers on most of it's key tables. On an INSERT/UPDATE/DELETE the audit table records get written with the domain table name and the before and after image using the following generic code if exists (select 1 from inserted) select @myai = CAST((SELECT TOP 1 * […] |
Development - SQL Server 2014 |
Export to Fixed width file - I have an SSIS process that I would like to replace. It imports an Excel file, transforms the data and exports to a text file. I am trying to create a stored procedure that will do the same so I can execute it from an agent job. All of the solutions I have seen do […] |
SQL Server 2019 - Administration |
SQL user and AD Group - Blank out the "Default Schema" - A previous DBA managed this before me. An application had a requirement to blank out the "Default Schema". See pic. Does anyone know how this was done? Every time I do it in SSMS the default schema reverts back the the previous schema. T-SQL, I couldn't get to do it either. |
SQL Server consolidation - infra and infosec applications - Hi, When I join my current company we had plenty of single porpoise SQL instances and my boss (senior DBA) indicated an consolidation effort... and left company. I am trying to proceed with his plan which was clear at the beginning but I encountered a few applications for which I have serious doubts. I wander […] |
Background CREATE INDEX process is blocked by an UPDATE and UPDATE waits - Hi, In one of our projects we are using SQL Server 2019 Enterprise ed. 15.0.4249.2 version and we have synchronous always on high availability in all databases. There we have 5 databases. So, in one database, we have a stored procedure running everyday which includes an update on a table in a different database and […] |
SQL Server 2019 - Development |
Connect PowerBI to SQL Server - TrustServerCertificate - Hi there, I have a problem with connecting my PowerBI desktop to my SQL server. I know 100% the problem lies with the 'TrustServerCertificate' attribute. When logging into to SSMS, or creating and ODBC data source, I need to ensure TrustServerCertificate is true. However, when using the SQL server connector (and the Azure SQL Server […] |
Add another column with some commands - i have a script below to find all the db fixed role db_datawriter. this is working fine, no issues. what i want to do is come up with a series of commands: drop the member from the db grant update, delete, insert to the member So the 5th column will look something like this: USE […] |
Joining tables - I'm a real beginner of SQL and have not managed to solve this. I'm trying to join all the information below. For this I want to use the customer_id whos in table 1 and table 2. The first step will be to join the last_name (table 2) into the new table. In the next […] |
SQL Azure - Administration |
Can an Azure Public Endpoint access/login be restricted to select Applications? - WARNING: Not an Azure veteran by any means (barely a newbie) so may ask some very dumb questions We've hired a 3rd party to migrate an on prem SQL Server DB to Azure and develop a cloud based solution to replace the current MS Access based application that has been accessing/using the SQL Server DB. […] |
Azure Data Factory |
Azure data factory - Hi all I was wondering if anyone knows where to go for help with azure data factory. I'm trying to use a derived column to create a column from data in another column. The problem is I don't know how to write the expression or where to look for help. The azure documentation isn't clear […] |
Reporting Services |
Need to migrate on prem SSRS to Azure Managed Instance - Can it possible to migrate the on prem SSRS to Azure Managed Instance ? I can see Hosting catalog databases for all supported versions of SSRS in Azure SQL Managed Instance. But don't think so, work with Managed Instance for SSRS some thing like on prem SSRS. As the reporting services won't be installed / […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |