Can anyone please tell me the difference between database level trigger and server level trigger in SQL Server ? Thanks in advance.
Tag: sql-server
Find all tables that have ROWGUIDCOL
IS there a system table I can join to so I can query to find all tables with a column flagged as ROWGUIDCOL? thanks! Answer You could utilize sys.columns with COLUMNPROPERTY: SqlFiddleDemo Output:
Remote connection to MS SQL – Error using pyodbc vs success using SQL Server Management Studio
I have a MS SQL database in the same network but in other computer. Using the SQL Server Management Studio (SSMS) Express, I can find the database and connect without problems. But when I use pyodbc to connect to the same server using: I get following error: OBS: I guess that the server string should be right…
how i can select records with varbinary type?
I have table in my database that has two column namely data and length. I declare data as a VARBINARY(MAX) and suppose the table has a record with length equal to 5 and data = 0x23 0x00 0x12 0x45 0x34. Table definition: The question: Is it possible to search (with a SELECT query) to find records that has 0x00…
WITH(NOLOCK) : where & when to use
I have 15 tables which are normalized to contain records and many user may be inserting/updating data in these tables( No two user can update the same record(s) simultaneously, this is restricted by client implementation). these 15 tables are updated 1 by 1 in a stored procedure. WITH(NOLOCK) is used where se…
SQL select where column begins with Letters
I have a table tbl1 with row of data: I want to query the the Legal_Doc_No of each ID. The value of each ID is either the TIN or the SSS column. How can I query the TIN and SSS column starting with letters (none) so that only values starting with numbers will be assigned to Legal_Doc_No Answer Most databases
Cannot catch SQL Server alter table error
It is a really simple code, but it cannot catch the error. Or how to catch the error? Thanks. Answer Errors that occur as a result of batch recompilation after deferred name resolution cannot be caught at the same level the error occurs. One work-around is to wrap the DDL in dynamic SQL:
Add emoji / emoticon to SQL Server table
I am trying to insert emoji / emoticons to a SQL Server database but it just stores ??? instead of the emoji / emoticons. I am finding only help for SQL Server not MySQL. I tried : link but not finding answers even not able to set with : SQL Server does not recognize this command. This is only for
SQL Select Adding a new row with difference between numbers
I have this query that give the sum between years but I want to add a new row at the end of each TARMA that give the differences between the years. Here is the query: Select VPC.Armazem as …
SQL Group By Sum and Nulls
I have a query that fetch the sum of quantity of a certain date with a GROUP BY, but the query is giving me NULL results and not aggregating some values. Here is the query: Select VPC.Armazem …