bigator

Archive for the ‘SQLServerPedia’ Category

Retrieving id of inserted record: What to use @@IDENTITY or SCOPE_IDENTITY() or OUTPUT

Hi guys, This seems very basic information but need to know properly. Issue: I need to find out or have the id of the records which I inserted in table. Analysis: This requirement seems very simple but there could be various cases where you would not get the correct id just by using @@IDENTITY function. Think […]

bigatorFebruary 6, 2013 · bigatorKhilitchandra Prajapati · bigatorNo Comments
bigatorTags: , , , , , ,  · Posted in: Business Intelligence, Free, General, Interview QA, Quick Fix, Quick Tips, Script, SQL Server, SQL Server 2012, SQLServerPedia, T-SQL, Training, Tutorial

The Story of Precision, Scale, and Length in SQL Server

Hi guys, Did you ever faced issues with BIG mathematical figures – related to either overflow or any  other arithmetic errors. This may be applicable to SQL arithmetic operations or arithmetic  operations you do with SQL table in SSIS etc. Well, check 1 more time, if you have any issues in your database design related […]

bigatorJanuary 28, 2013 · bigatorKhilitchandra Prajapati · bigatorOne Comment
bigatorTags: , , , , ,  · Posted in: Business Intelligence, Free, General, Interview QA, Quick Fix, Quick Tips, Script, SQL Server, SQL Server 2012, SQLServerPedia, SSAS, SSIS, SSRS, T-SQL, Tutorial

MSSQL: Find total records of each Table in given Database

hi guys, i wanted to do a quick post on how you can find total number of records in each table of the database. here is the script you can use: USE <Your Database Name> GO ;WITH CTE_DATABASETABLESIZE (DATABASENAME, SCHEMANAME, TABLENAME, TOTALROWS) AS ( SELECT  DB_NAME(), SCHEMA_NAME(SO.UID), SO.NAME, SI.ROWS FROM  SYSOBJECTS SO  INNER JOIN SYSINDEXES […]

bigatorJanuary 23, 2013 · bigatorKhilitchandra Prajapati · bigatorOne Comment
bigatorTags: ,  · Posted in: Business Intelligence, General, Interview QA, SQL Server, SQL Server 2012, SQLServerPedia, SSAS, SSIS, SSRS

Fastest way to find-out/understand relationships between tables in MS SQL Database

Hi guys, For most of the BI developers, getting BI related tasks (SSAS, SSIS, SSRS etc.) from multiple teams in company is very common. So in this situation, developer completes a task(s) for one team and goes to another team for different task(s). Once you go to the team for their requirements … lets say […]

bigatorFebruary 3, 2012 · bigatorKhilitchandra Prajapati · bigator3 Comments
bigatorTags: , ,  · Posted in: Database Diagram, SQL Server, SQLServerPedia, Tutorial, Visio


bigator