Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. MastermindSQL

    List Stored procedures

    Sorry, it works in SQL 2005 also. I thought Microsoft has changed the system table schema in 2005. Anyway it is good.
  2. MastermindSQL

    List Stored procedures

    SELECT p.[name] ProcName, c.[name] InputParam, t.[name] DataType, t.length Length FROM sysobjects p JOIN syscolumns c ON p.[id] = c.[id] JOIN systypes t ON c.xtype = t.xtype WHERE p.xtype = 'p' AND p.[name] NOT LIKE 'dt_%' AND t.[name] NOT LIKE 'sysname' /*** will not work in SQL...
  3. MastermindSQL

    SQL Query help

    Hi Jim, there is nothing in alphabetical/ numeric order. It is basically like a linked list. For example Item A points to "NextItem" Item X and so on. A simple ORDER BY will not solve this problem. Item --> NextItem --> AnotherItem and so on. I need to get what is the ordering of each Item...
  4. MastermindSQL

    SQL Query help

    Borislav Borissov, What if my table is like: PK ID NextID -- --- ------ 1 AXD NNQ 2 AYX AXD 3 NNQ QWX 4 ABC AYX Now I want to get a resultset like: ID DisplayOrder --- ------------ ABC 1 AYX 2 AXD 3 NNQ 4 QWX 5
  5. MastermindSQL

    SQL Query help

    I have a table in a following format: PK ID NextID -- --- ------ 1 200 300 2 100 200 3 300 400 4 50 100 Now I want to get a resultset like: ID DisplayOrder --- ------------ 50 1 100 2 200 3 300 4 400 5 Thanks in advance.
  6. MastermindSQL

    SQL Statement Help

    Add these before you do the INSERT : USE Test ====================================================== CREATE DATABASE Test GO CREATE TABLE Test..Job_Title ( Job_Title_Code nvarchar(50) NOT NULL CONSTRAINT PK_Job_Title_Code PRIMARY KEY NONCLUSTERED, Job_Title nvarchar(50) NOT NULL...
  7. MastermindSQL

    SQL Server Best Practice

    What is the difference between the following two cases: Case 1: CREATE PROC MyProc AS ..... RETURN GO ---------- BEGIN TRAN EXEC MyProc COMMIT =================== Case 2: CREATE PROC MyProc AS BEGIN TRAN ..... COMMIT RETURN GO ---------- EXEC MyProc Which one of the above is a...
  8. MastermindSQL

    Possible to pass arrays into a stored procedure?

    Use XML data as input parameter. With XML you can pass in multiple sets of records.
  9. MastermindSQL

    syntac error Help

    Change your variable declaration for @TableName varchar(50) to following: DECLARE @TableName SysName Your code should be like: =================================================== BEGIN DECLARE @LastFullUpdate datetime ,@LastIncrementalUpdate datetime ,@LastUpdatedDt...
  10. MastermindSQL

    program save file

    Here is one solution: --Create a work table CREATE TABLE Temp (Col1 varchar(200), Col2 varchar(200)) INSERT INTO Temp ( Col1, Col2 ) SELECT Col1, Col2 /*Your main query goes here*/ FROM MyTable --BCP out the query result saved in Work table EXEC Master..XP_CmdShell 'bcp...
  11. MastermindSQL

    Checking objects before compiling Stored Proc

    Could someone suggest me a way to check the underlying objects while compiling a stored procedure? For example if I have a code like this: --------------------------- CREATE PROC dbo.FOO AS SELECT Col1, Col2 FROM dbo.NonExistingTable RETURN GO --------------------------- In this case the...

Part and Inventory Search

Back
Top