• Got a Tipila, google, windows live or facebook account ?
Tips tagged: tsql
1
votes
Here's how to backup all the db s on the server to a single .bak file using tsql in sql server. DECLARE @name VARCHAR(50) DECLARE @path VARCHAR(256) DECLARE @fileName VARCHAR(256) DECLARE @fileDate VARCHAR(20) SET @path = 'h:\Backup\' SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) DECLARE db_cursor CURSOR FOR SE ...
1
votes
This is how to update a column of a table to be the group-by-count of rows, in another table. User table has a field called postcount which represents the number of posts that a user has made. And the Tip table has all the posts. So we are going to get the number of posts that a user has made from the Tip table and set ...
1
votes
This is how to check a column exists in tsql if Exists(select * from sys.columns where Name = N'columnName' and Object_ID = Object_ID(N'tableName')) begin -- your code end
0
votes
with counts as ( select tag.Id, count(tip_tag.TipId) as cn from tag left outer join tip_tag on tag.Id = tip_tag.tagId group by tag.id ) update tag set tipcount = (select cn from counts where counts.Id = tag.Id)
4
Matching Tips
Search options
  • Use the syntax:
    seach text, tag1, tag2,...
    to search for tips with the given tags.
  • Add ,mytips to the search text to search within MyTips only.
  • Use the syntax:
    ,tag1, tag2,...  to get all tips with the given tags.
Login to Tipila