Convert the string value to multiple rows in sql server
hi this is my requirement.---Inputdeclare @name varchar(10) = 'Server'select @name---Output:S e r v e r
View ArticleComparing 2 functions for any differences in the result set.
Recently, we've done some optimizations to the functions and now the BI Manager has tasked me with a request to compare the result of the 2 functions as below making sure the row counts match, along...
View ArticleT-SQL Store procedure variable
HiSorry a bit new to T-SQL!I have the following store procedure EXECUTE sp_sqlbackup @Databases = 'all', @URL = 'https://storage.blob.core.windows.net/sqlbackup', @Credential = 'Backup', @Backup =...
View ArticleQuery to find the user who changed the name of table of a database
Dear All,Kindly guide me to find out the user who had changed the name of table of a database.Basically I have got the date and time on which the table name was modified; however I would need to...
View ArticleSQl to calculate average time for call centre agents
A row is created in the CALLSTATUSLOGGING table every time an agent's state is changed. A row is also inserted when the application is started, the application is closed and an interaction (i.e. call)...
View Articlequery format
[code language="sql"]CREATE TABLE [dbo].[Title]( [ID] [int] NULL, [Description] [varchar](50) NULL) ON [PRIMARY]INSERT INTO [dbo].[Title]([ID],[Description])VALUES(1,'Architect'
View ArticleHaving trouble displaying a date in a certain format...
[code language="sql"]Select Invoice_Exceptions.Invoice_Number, Invoice_Exceptions.ItemNum, Inventory.ItemName, Invoice_Exceptions.Amount, Invoice_Exceptions.Quantity, Invoice_Exceptions.Reason_Code,...
View ArticleCreating Stored Procedure
New to SQL Server. Looking for help with the following design problem:Query:Create a procedure named 'delete_asset_log' that takes 1 input listed below:@assetlog_id INTBased on this input,
View ArticleCould not delete from specified MS access tables from SSIS execute task
I am working in migration project to upgrade current sql server 2008 SSIS jobs into new SQL server 2014 in windows 2012 server.One of my SSIS job step using MS Access 2010 (.mdb) tables in SQL...
View ArticleColumnstore index question
I have some large ETL tables that i've created to snapshot production OLTP data that is sourced from more than one server and product. The tables are wide, about 70 columns, and queried mostly by the...
View ArticleOpen sql files in single instance of ssms
I recently had to reinstall ssms on my local machine. Now, when I double-click on .sql files on my local machine they open in separate instances of ssms. They used to open in multiple tabs in a single...
View ArticleOptimizing Query Using LInked Servers
Hello.Looking at an SP that used to run in a couple of seconds and does something like this :Select X,Y,U as Z into #TMP from TableA as A Inner Join Table B............UNION ALLSelect X,Y,V as Z into&
View ArticleCreating a Gantt Chart using SQL?
Hello.I am trying to develop the concept of a report of utilization of barcode scanning devices over time, and just looking for pointers and suggestions for SQL techniques.Assuming that when a Device...
View ArticleHow to get columns which has null's
Hi Experts,Need some tsql help. I wanted all the column names from all below 3 tables which has nulls. i.e. The if the column has a NULL value in table1 and table 2 and table 3, display that column in
View ArticleTRUNCATE and INSERT INTO slower than TRUNCATE GO INSERT INTO
Hi guys,i wonder why executing a TRUNCATE and INSERT INTO Command is mutch slower than executing these commands separately ?Conditions:recovery model: simpletable1 & table 2 have same structure...
View ArticleSSRS Chart Custom Colors by Category Group
I have a graph with two related Categories. One is Production, the other Estimating. Within each category there are up to six departments. It is a stacked column chart. Values are in hours....
View ArticleErrors 0xc02020f4 when trying to load CSV file into SQL Server DB
Hello,I try to load a big CSV file (10M lines, 100 columns!) into a SQL Server 2014 DB .In input, I have:- a CSV file, generated by an external company with these parameters (impossible to make it use...
View Articlecould some one help me with the query below
ExecuteSql"(varchar(max),"USE MASTERdeclare @isql varchar(2000), @dbname varchar(64), @logfile varchar(128) declare c1 cursor for &nb
View ArticleWhy is my T-SQL code so slow with its output?
[code language="sql"]Select Invoice_Exceptions.Invoice_Number as Invoice#, FORMAT(Invoice_Exceptions.DateTime, 'MM-dd-yyyy') as Void_Date, Invoice_Exceptions.ItemNum as Item_#_Removed,...
View ArticleTrigger error and comments on it ?
Hello,I have multiple triggers which do similar things, like updating some summary field of one table based on values/number of records in another table. They all have similar design. I don't do...
View Article