code_junkie

What is the easiest way to get total number for lines of code (LOC) in SQL Server?

Nov 10th, 2011
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. $conn = new-object System.Data.SqlClient.SqlConnection("Server=server;Database=database;Integrated Security=SSPI")
  2. $cmd = new-object System.Data.SqlClient.SqlCommand("select text from syscomments", $conn)
  3. $conn.Open()
  4. $reader = $cmd.ExecuteReader()
  5.  
  6. $reader.Read() | out-null
  7. $reader.GetString(0) | clip
  8. $reader.Close()
  9. $conn.Close()
Add Comment
Please, Sign In to add comment