Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

sql-server-2005

Measure the time it takes to execute a t-sql query

October 19, 2022 by Tarik

If you want a more accurate measurement than the answer above: set statistics time on — Query 1 goes here — Query 2 goes here set statistics time off The results will be in the Messages window. Update (2015-07-29): By popular request, I have written a code snippet that you can use to time an … Read more

Categories performance Tags performance, sql-server-2005 Leave a comment

What is the difference between a stored procedure and a view?

October 19, 2022 by Tarik

A view represents a virtual table. You can join multiple tables in a view and use the view to present the data as if the data were coming from a single table. A stored procedure uses parameters to do a function… whether it is updating and inserting data, or returning single values or data sets. … Read more

Categories sql Tags sql, sql-server-2005, stored-procedures, views Leave a comment

Difference between database and schema

October 17, 2022 by Tarik

A database is the main container, it contains the data and log files, and all the schemas within it. You always back up a database, it is a discrete unit on its own. Schemas are like folders within a database, and are mainly used to group logical objects together, which leads to ease of setting … Read more

Categories sql-server Tags database, database-schema, sql-server, sql-server-2005 Leave a comment

What good are SQL Server schemas?

October 17, 2022 by Tarik

Schemas logically group tables, procedures, views together. All employee-related objects in the employee schema, etc. You can also give permissions to just one schema, so that users can only see the schema they have access to and nothing else.

Categories sql-server-2005 Tags schema, sql-server-2005, theory Leave a comment

nvarchar(max) vs NText

October 17, 2022 by Tarik

The advantages are that you can use functions like LEN and LEFT on nvarchar(max) and you cannot do that against ntext and text. It is also easier to work with nvarchar(max) than text where you had to use WRITETEXT and UPDATETEXT. Also, text, ntext, etc., are being deprecated (http://msdn.microsoft.com/en-us/library/ms187993.aspx)

Categories sql-server Tags nvarchar, sql-server, sql-server-2005, sql-server-2008, text Leave a comment

How do I check if a SQL Server text column is empty?

October 16, 2022 by Tarik

where datalength(mytextfield)=0

Categories sql-server Tags emptydatatext, notnull, sql-server, sql-server-2005, sqldatatypes Leave a comment

How to check which locks are held on a table

October 15, 2022 by Tarik

This is not exactly showing you which rows are locked, but this may helpful to you. You can check which statements are blocked by running this: select cmd,* from sys.sysprocesses where blocked > 0 It will also tell you what each block is waiting on. So you can trace that all the way up to … Read more

Categories sql Tags database, performance, sql, sql-server, sql-server-2005 Leave a comment

Sql Server string to date conversion

October 15, 2022 by Tarik

Try this Cast(‘7/7/2011’ as datetime) and Convert(DATETIME, ‘7/7/2011’, 101) See CAST and CONVERT (Transact-SQL) for more details.

Categories sql-server Tags datetime, sql-server, sql-server-2005, string-to-datetime, tsql Leave a comment

SQL Server Restore Error – Access is Denied

October 14, 2022 by Tarik

I have just had this issue with SQL Server 2012. It turns out all I had to do was tick the box marked ‘Relocate all files to folder’ on the ‘Files’ section: (Click to see image full size) This of course assumes you have the correct version of SQL Server installed.

Categories sql-server Tags backup, restore, sql-server, sql-server-2005 Leave a comment

Difference between a User and a Login in SQL Server

October 13, 2022 by Tarik

A “Login” grants the principal entry into the SERVER. A “User” grants a login entry into a single DATABASE. One “Login” can be associated with many users (one per database). Each of the above objects can have permissions granted to it at its own level. See the following articles for an explanation of each Principals … Read more

Categories sql Tags sql, sql-server, sql-server-2005 Leave a comment
Older posts
Newer posts
← Previous Page1 … Page38 Page39 Page40 … Page45 Next →

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa