0%
Loading ...

Category: MS SQL Management Studio

  • SQL SERVER – ENABLE QUERIES THAT REQUIRE TABLE RECREATION

    SQL SERVER – ENABLE QUERIES THAT REQUIRE TABLE RECREATION

    At Sql Server Management studio sometime We run queries that changes table properties or structure. At this point We get an error message that says something like: “Please drop and recreate table…”. The solution for it is here:

    Continue reading

  • MS SQL Server Editions

     MS SQL Server Editions Also include Express editions http://www.microsoft.com/en-us/server-cloud/products/sql-server-editions/sql-server-express.aspx

    Continue reading

  • Step by step of executing SSIS 2012 package through stored procedure

    Step by step of executing SSIS 2012 package through stored procedure http://blogs.msdn.com/b/biblog/archive/2013/05/07/step-by-step-of-executing-ssis-2012-package-through-stored-procedure.aspx

    Continue reading

  • Multiplication Table – Stored Procedure

    ALTER PROCEDURE [dbo].[Mulsp] @Size INT AS BEGIN DECLARE @X INT=2 DECLARE @Y INT=1 BEGIN try DROP TABLE [dbo].[multable] END try BEGIN catch END catch CREATE TABLE [dbo].[multable] ( c1 INT ) –create the rows  DECLARE @CN NVARCHAR(max)=” DECLARE @TSql NVARCHAR(max) WHILE @x <= @Size BEGIN SELECT @cn = ‘c’ + Cast(@x AS NVARCHAR) PRINT @cn SET @TSql=‘alter table MulTable add ‘ + @cn + ‘ int’ PRINT @Tsql EXEC sys.Sp_sqlexec @Tsql SET @x=@x + 1 END –at this point build each line query  SET @X=1 DECLARE @EachLineQuery NVARCHAR(max) WHILE @Y <= @Size BEGIN SET @EachLineQuery=‘insert into MulTable values (‘ WHILE @x < @Size BEGIN SET @EachLineQuery=@EachLineQuery + Cast(@x*@y AS NVARCHAR) + ‘,’ SET @x=@x + 1 END SET @EachLineQuery=@EachLineQuery + Cast(@x*@y AS NVARCHAR) + ‘)’ EXEC sys.Sp_sqlexec @EachLineQuery PRINT @EachLineQuery SET @EachLineQuery=” SET @y=@y + 1 SET @x=1 END SELECT * FROM   multable END

    Continue reading