Relative Content

Tag Archive for sqlsql-serversql-server-2012

Splitting one row into multiple rows based on column values

I have a table with ID, type, amount and hour. The input dataset is in a table and output dataset should be loaded into a fixed width file.
I have a table with ID, type, amount and hour. The input dataset is in a table and output dataset should be loaded into a fixed width file.

Splitting one row into multiple rows based on column values

I have a table with ID, type, amount and hour. The input dataset is in a table and output dataset should be loaded into a fixed width file.
I have a table with ID, type, amount and hour. The input dataset is in a table and output dataset should be loaded into a fixed width file.

Optimize a SQL Query to Count Non-Blank Column Values Without Using a Cursor?

I have written a T-SQL script to count non-blank values in each column across all tables in a database. The script currently uses a cursor to iterate through each column and dynamically generate and execute SQL to count the values, excluding blanks and, in the case of date columns, excluding the date ‘1900-01-01’. Here is the script:

Query Execution time is too Late to Fetch the Data

Select substring(Downloading_Date,7,2)+’/’+substring(Downloading_Date,5,2)+’/’+substring(Downloading_Date,1,4) Downloading_Date, Count(1) TotalCount From DWN_AdmitCard_Details DA Inner Join DownloadType_Master As DM On DA.AdmitCard_Type = DM.Download_TypeID Where Adv_Code=’202′ and AdmitCard_Type=’P’ Group by Downloading_Date order by Downloading_Date Desc Here is my query it is taking too much time to execute and fetch the record from database is there any suggestion how should i speed up […]